-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
106 lines (95 loc) · 2.49 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
" vim
set number
set ruler
set pastetoggle=<F2>
set expandtab
set tabstop=2
set smarttab
set showmatch
set ignorecase
set smartcase
set hlsearch
set hidden
set nomodeline
set autoindent
filetype plugin indent on
set shiftwidth=2
set shiftround
set softtabstop=2
set mouse=a
set wildmenu
set wildmode=list:longest
set splitright
set splitbelow
" plugins
call plug#begin()
Plug 'itchyny/lightline.vim'
Plug 'preservim/nerdtree'
Plug 'christianchiarulli/nvcode-color-schemes.vim'
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'jiangmiao/auto-pairs'
Plug 'machakann/vim-sandwich'
Plug 'preservim/nerdcommenter'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'ryanoasis/vim-devicons'
call plug#end()
" treesitter
lua << EOF
require'nvim-treesitter.configs'.setup {
ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
highlight = {
enable = false, -- false will disable the whole extension
disable = { "c", "rust" }, -- list of language that will be disabled
},
}
EOF
" lightline
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ],
\ 'right': [['clock'], ['lineinfo'], ['percent'], ['fileformat', 'fileencoding', 'filetype']],
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead'
\ },
\ 'component': {
\ 'clock': '%{strftime("%H:%M")}'
\ },
\ }
" nvcode
let g:nvcode_termcolors = 256
" NERDTree
let g:NERDTreeShowHidden = 1
let g:NERDTreeMinimalUI = 1
let g:NERDTreeIgnore = []
let g:NERDTreeStatusline = ''
" close vim if NERDTree is last buffer
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" toggle NERDTree with Ctrl+B
nnoremap <silent> <C-b> :NERDTreeToggle<CR>
" NERDCommenter
let g:NERDSpaceDelims = 1
let g:NERDDefaultAlign = 'left'
let g:NERDCommentEmptyLines = 1
let g:NERDTrimTrailingWhitespace = 1
colorscheme nvcode
" checks if your terminal has 24-bit color support
"if (has("termguicolors"))
" set termguicolors
" hi LineNr ctermbg=NONE guibg=NONE
"endif
" turn terminal to normal mode with escape
tnoremap <Esc> <C-\><C-n>
" start terminal in insert mode
au BufEnter * if &buftype == 'terminal' | :startinsert | endif
" open terminal with ctrl+n
function! OpenTerminal()
split term://bash
resize 10
endfunction
nnoremap <c-n> :call OpenTerminal()<CR>
" Mappings
let mapleader = ","
inoremap jj <esc>