-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
108 lines (92 loc) · 4.05 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
106
107
"####Vim config####"
set encoding=utf-8
set t_Co=256 "makes Vim use 256 colors
set nu "show line number
set autoindent "automatic indentation
set si "smart indent
set cindent "turns on C style indentation
set showmatch "show matching brackets
set hlsearch "highlight in search
set pastetoggle=<C-p> "paste mode toggle
syntax enable "enable color sheme code
if(empty($TMUX)) | set termguicolors | endif "sync colorsheme with terminal
"autocmd vimenter * ++nested colorscheme gruvbox
colorscheme gruvbox "install them from AUR -> vim-gruvbox-git & vim-airline-gruvbox-git
set bg=dark "set dark mode in gruvbox theme
"switch between tab
nnoremap <C-Left> :tabprevious<CR>
nnoremap <C-Right> :tabnext<CR>
nnoremap <C-h> :tabprevious<CR>
nnoremap <C-l> :tabnext<CR>
"auto complete for ( , " , ' , [ , {
inoremap ( ()<Left>
inoremap " ""<Left>
inoremap ` ``<Left>
inoremap ' ''<Left>
inoremap [ []<Left>
inoremap { {}<Left>
"####Vim plug####"
call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree'
call plug#end()
"####Plugin config####"
"airline
let g:airline_theme='gruvbox' "select them for aireline
let g:airline#extensions#tabline#enabled = 1 "showing tabs
"--set symbols for open file tab
let g:airline#extensions#tabline#left_sep = '▶'
let g:airline#extensions#tabline#left_alt_sep = '▶'
let g:airline_powerline_fonts = 0
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
"--unicode symbols
"let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
"let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
"--airline symbols
"let g:airline_left_sep = ''
"let g:airline_left_alt_sep = ''
"let g:airline_right_sep = ''
"let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
"let g:airline_symbols.linenr = ''
"--unicode->airline symbol
"let g:airline_symbols.linenr = '␊'
"let g:airline_symbols.linenr = ''
let g:airline_symbols.linenr = '¶'
"let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
"let g:airline_symbols.paste = 'Þ'
"let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
"nerdtree
"--NERDTree shortcut toggle
map <C-e> :NERDTreeToggle<CR>
"--open a NERDTree automatically when vim starts up if no files were specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
"--open NERDTree and a new edit window in folder
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
"--close vim if the only window left open is a NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
"--close nerdree after open a file
let NERDTreeQuitOnOpen=1
"--NERDTress File highlighting
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515')
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('htm', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515')