-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
221 lines (187 loc) · 5.79 KB
/
init.vim
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
"------------------------
"VIMPLUG
"------------------------
call plug#begin('~/.vim/plugged')
Plug 'https://github.com/flazz/vim-colorschemes.git'
Plug 'https://github.com/vim-airline/vim-airline.git'
Plug 'https://github.com/vim-airline/vim-airline-themes.git'
Plug 'dracula/vim'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'https://github.com/tomtom/tcomment_vim.git'
Plug 'https://github.com/raichoo/haskell-vim.git'
Plug 'https://github.com/tomasr/molokai.git'
Plug 'https://github.com/octol/vim-cpp-enhanced-highlight.git'
Plug 'https://github.com/Yggdroot/indentLine.git'
Plug 'https://github.com/owickstrom/vim-colors-paramount.git'
Plug 'https://github.com/gerw/vim-HiLinkTrace.git' "Plugin for tracing syntax groups
call plug#end()
"------------------------
"MISC
"------------------------
"Change leader key to space!
let mapleader=" "
set tabstop=4 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" Vim will interpret it to be having
" a width of 4.
set shiftwidth=4 " Indents will have a width of 4
set softtabstop=4 " Sets the number of columns for a TAB
set expandtab
set shiftround
syntax enable
syntax on
" set number
" Highlight search results
set hlsearch
:set nowrap
" endif
" Put plugins and dictionaries in this dir (also on Windows)
let vimDir = '~/.vim'
let &runtimepath.=','.vimDir
" Keep undo history across sessions by storing it in a file
if has('persistent_undo')
let myUndoDir = expand(vimDir . '/undodir')
" Create dirs
call system('mkdir ' . vimDir)
call system('mkdir ' . myUndoDir)
let &undodir = myUndoDir
set undofile
endif
set clipboard=unnamedplus
"See help completion for source,
"Note: usual completion is on <C-n> but more trouble to press all the time.
"Never type the same word twice and maybe learn a new spellings!
"Use the Linux dictionary when spelling is in doubt.
"Window users can copy the file to their machine.
function! Tab_Or_Complete()
if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
return "\<C-N>"
else
return "\<Tab>"
endif
endfunction
:inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>
:set dictionary="/usr/dict/words"
:set noswapfile
filetype on
filetype indent on
filetype plugin on
" let g:indentLine_char = ' '
" let g:indentLine_char = '¦'
" let g:indentLine_char = '┆'
let g:indentLine_char = '│'
" let g:indentLine_char = '.'
" let g:indentLine_char = '»'
" of ¦, ┆, or │ t
" set listchars=eol:¬
" set list
" ,tab:>-,trail:~,extends:>,precedes:<
" let g:cpp_experimental_template_highlight = 1
let g:cpp_class_scope_highlight = 1
"------------------------
" Haskell
"------------------------
let g:haskell_indent_if = 4
let g:haskell_indent_case = 4
let g:haskell_indent_let = 4
" let g:haskell_indent_where = 4
let g:haskell_indent_where = 0
let g:haskell_indent_do = 4
let g:haskell_indent_in = 4
let g:cabal_indent_section = 4
"------------------------
" Keymapping
"------------------------
set timeoutlen=1000 ttimeoutlen=0
set laststatus=2
imap jj <Esc>
nnoremap <Leader>r :%s/\s\+$//e<CR>
imap <C-l> λ
" Alt based shortcuts, uses Esc, thus some things, like visual mode, require
" pressing Esc twice it sees...
map <M-k> {
map <M-j> }
:nnoremap <M-l> :bnext<CR>
:nnoremap <M-h> :bprevious<CR>
:tnoremap <M-l> <C-\><C-n>:bnext<CR>
:tnoremap <M-h> <C-\><C-n>:bprevious<CR>
tnoremap <ESC><ESC> <C-\><C-N>
nnoremap <C-l> :bnext<CR>
nnoremap <C-h> :bprevious<CR>
map <C-k> {
map <C-j> }
:set wildignore+=*uasset,*.o,*.obj,*.meta,*.mat,*.hi,*.jpg,*.png,*.psd,*.controller,*.fbx,*.anim,*.unity,*.db,*.pdf,*.prefab,*.tif,**/.git/*,**/.svn/*,*.tga,*.dll,*.sln,*.zip,*.lnk,*.assets,*.bmp,*.TTF,*.apk,*.wavm,*.lib,*.dyn_hi,*.dyn_o,**/dist
"Find .h or .cpp files
map <LEADER>f :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,<CR>
map <LEADER>u :%s/\r/\r/g<CR>
map <LEADER>t :FZF<CR>
let g:tcommentMapLeaderOp1 = '<Leader>c'
let g:tcommentMapLeaderOp2 = '<Leader>c'
"Paste without filling buffer
xnoremap p pgvy
"------------------------
" Splits
"------------------------
set splitright
nnoremap <LEADER>h :wincmd h<CR>
nnoremap <LEADER>j :wincmd j<CR>
nnoremap <LEADER>k :wincmd k<CR>
nnoremap <LEADER>l :wincmd l<CR>
"------------------------
" COLORSCHEME
"------------------------
" " Customize some colors in dracula
colorscheme dracula
" hi Normal guibg=#1B1F20
" hi Operator ctermfg=LightBlue guifg=#2EAfCf
" hi Delimiter ctermfg=LightGreen guifg=#00E080
colorscheme paramount
" colorscheme jellybeans
" let g:molokai_original = 1
" colorscheme molokai
" let g:molokai_original = 1
" colorscheme jellybeans
" colorscheme wolfpack
" colorscheme muon
" colorscheme sky
" colorscheme inkpot
" :set cursorline
" Make custom colorscheme?
hi Normal ctermbg=None guibg=None guifg=#D0D0D0
hi Operator ctermfg=DarkGrey guifg=#4070A0
hi Delimiter ctermfg=White guifg=#10A0C0
hi cCustomParen ctermfg=White guifg=#10A0C0
hi Identifier gui=italic guifg=#406090
hi cStorageClass guifg=#505060
hi Structure guifg=#505060
hi label guifg=#505060
hi cInclude guifg=#505060
hi cCustomClass guifg=#767676
hi cType guifg=#767676
hi Type guifg=#767676
hi Normal guibg=#1F1F1F
hi Normal ctermfg=None guibg=#1B1F20
"------------------------
" AIRLINE
"------------------------
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline_left_sep = ''
let g:airline_right_sep = ''
" let g:airline_left_sep = '>'
" let g:airline_right_sep = '<'
" let g:airline_right_sep = ''
" let g:airline_left_sep = ''
let g:airline_theme='lucius'
" let g:airline_theme='dracula'
" let g:airline_theme='zenburn'
" let g:airline_theme='jellybeans'
" let g:airline_theme='serene'
" let g:airline_theme='simple'
" let g:airline_theme='sky'
"
"
"
"