Changeset 9bc0481 in dotfiles for vim/.vimrc
- Timestamp:
- Dec 12, 2024, 4:57:35 PM (5 weeks ago)
- Branches:
- master
- Children:
- eb58262
- Parents:
- f30e1cd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vim/.vimrc
rf30e1cd r9bc0481 1 " Initialization 1 syntax on 2 3 packadd vimcomplete 4 2 5 filetype plugin on 3 syntax enable 4 set autoindent 6 set omnifunc=syntaxcomplete#Complete 5 7 6 call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged') 7 Plug 'tpope/vim-fugitive' 8 Plug 'tpope/vim-surround' 9 Plug 'tpope/vim-dadbod' 10 Plug 'qbbr/vim-symfony' 11 Plug 'vim-syntastic/syntastic' 12 call plug#end() 13 14 " Backups 15 set directory=~/.vim/backups/ 16 17 " Undo history 18 set undofile 19 set undodir=~/.vim/undo/ 20 21 " Display maximum char width line 22 set colorcolumn=80 23 24 " Syntax checker 25 set statusline+=%#warningmsg# 26 set statusline+=%{SyntasticStatuslineFlag()} 27 set statusline+=%* 28 29 let g:syntastic_always_populate_loc_list = 1 30 let g:syntastic_auto_loc_list = 1 31 let g:syntastic_check_on_open = 1 32 let g:syntastic_check_on_wq = 0 33 34 " Better command completion 35 set wildmenu 36 set wildmode=list:longest,full 37 38 " Emacs keys in insert mode 39 imap <C-p> <Up> 40 imap <C-n> <Down> 41 imap <C-b> <Left> 42 imap <C-f> <Right> 43 imap <C-a> <C-o>:call <SID>home()<CR> 44 imap <C-e> <End> 45 imap <C-d> <Del> 46 imap <C-h> <BS> 47 imap <C-k> <C-r>=<SID>kill()<CR> 48 49 function! s:home() 50 let start_column = col('.') 51 normal! ^ 52 if col('.') == start_column 53 normal! 0 54 endif 55 return '' 56 endfunction 57 58 function! s:kill() 59 let [text_before, text_after] = s:split_line() 60 if len(text_after) == 0 61 normal! J 62 else 63 call setline(line('.'), text_before) 64 endif 65 return '' 66 endfunction 67 68 function! s:split_line() 69 let line_text = getline(line('.')) 70 let text_after = line_text[col('.')-1 :] 71 let text_before = (col('.') > 1) ? line_text[: col('.')-2] : '' 72 return [text_before, text_after] 73 endfunction 8 " For built in omnifunc 9 autocmd FileType sql setlocal omnifunc=vim_dadbod_completion#omni
Note:
See TracChangeset
for help on using the changeset viewer.