aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/init/basic.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/init/basic.vim')
-rw-r--r--vim/init/basic.vim34
1 files changed, 28 insertions, 6 deletions
diff --git a/vim/init/basic.vim b/vim/init/basic.vim
index b268c6b..e18423d 100644
--- a/vim/init/basic.vim
+++ b/vim/init/basic.vim
@@ -120,12 +120,7 @@ endfunction
120nnoremap <silent> <C-c> :call Bye()<CR> 120nnoremap <silent> <C-c> :call Bye()<CR>
121 121
122" }}} 122" }}}
123 123" Go to last cursor position ----------------{{{
124" Don't unload a buffer when no longer shown in a window
125" This allows you open a new buffer and leaves current buffer modified
126set hidden
127
128" ":augroup vimStartup | au! | augroup END"
129augroup vimStartup 124augroup vimStartup
130 au! 125 au!
131 " When editing a file, always jump to the last known cursor position. 126 " When editing a file, always jump to the last known cursor position.
@@ -139,6 +134,7 @@ augroup vimStartup
139augroup END 134augroup END
140 135
141" }}} 136" }}}
137" }}}
142" TABSIZE ----------------{{{ 138" TABSIZE ----------------{{{
143 139
144set expandtab 140set expandtab
@@ -178,6 +174,32 @@ set backupdir=~/.vim/tmp
178" backup when write file 174" backup when write file
179set writebackup 175set writebackup
180" }}} 176" }}}
177" HIGHLIGHT ----------------{{{
178syntax enable
179
180function! GetHighlightGroupName()
181 let l:syntaxID = synID(line('.'), col('.'), 1)
182 let l:groupName = synIDattr(l:syntaxID, 'name')
183 echo "Highlight Group Name: " . l:groupName
184endfunction
185
186" Defualt highlight for matched parenthesis is so weird in many colorscheme
187" Why the background color is lighter than my caret !?
188" highlight MatchParen ctermfg=NONE ctermbg=darkgrey cterm=NONE
189highlight LuaParen ctermfg=NONE ctermbg=darkgrey cterm=NONE
190
191" Show trailing spaces
192highlight ExtraWhitespace ctermbg=red guibg=red
193match ExtraWhitespace /\s\+$/
194
195" Persist visualized lines
196" define line highlight color
197highlight MultiLineHighlight ctermbg=LightYellow guibg=LightYellow ctermfg=Black guifg=Black
198" highlight the current line
199nnoremap <silent> <leader>gh :call matchadd('MultiLineHighlight', '\%'.line('.').'l')<CR>
200" clear all the highlighted lines
201nnoremap <silent> <leader>gH :call clearmatches()<CR>
202" }}}
181" MISC ----------------{{{ 203" MISC ----------------{{{
182 204
183" Use Unix way to add newline 205" Use Unix way to add newline