152 lines
4.1 KiB
VimL
Executable File
152 lines
4.1 KiB
VimL
Executable File
let g:ctrl_semicolon_key_code="<Esc>[69;50S"
|
|
|
|
set number
|
|
|
|
set expandtab
|
|
set softtabstop=4
|
|
set tabstop=4
|
|
set shiftwidth=4
|
|
set textwidth=99999999
|
|
set wrapmargin=0
|
|
set nowrap
|
|
set formatoptions-=t
|
|
set clipboard=unnamedplus
|
|
set mouse=n
|
|
set noswapfile
|
|
set backspace=indent,eol,start
|
|
set ttimeoutlen=5
|
|
|
|
|
|
let g:ale_enabled = 0
|
|
|
|
" For YCM
|
|
let g:ycm_auto_trigger = 0
|
|
let g:ycm_auto_hover = ''
|
|
let g:ycm_signature_help = 0
|
|
let g:ycm_show_diagnostics_ui = 0
|
|
set completeopt=menuone,popup
|
|
let g:ycm_server_keep_logfiles = 0
|
|
|
|
set nocompatible
|
|
" filetype off
|
|
" set rtp+=~/.vim/bundle/Vundle.vim
|
|
set rtp+=~/.vim/bundle/ale
|
|
set rtp+=~/.vim/bundle/nerdtree
|
|
set rtp+=~/.vim/bundle/vim-airline
|
|
set rtp+=~/.vim/bundle/YouCompleteMe
|
|
" filetype plugin indent on
|
|
|
|
syntax on
|
|
set signcolumn=yes
|
|
highlight Normal ctermbg=NONE guibg=NONE
|
|
highlight SignColumn term=standout ctermfg=14 ctermbg=37 guifg=Cyan guibg=LightSeaGreen
|
|
highlight EndOfBuffer ctermbg=NONE ctermfg=37 guibg=NONE guifg=LightSeaGreen
|
|
highlight Pmenu ctermbg=darkblue ctermfg=white
|
|
highlight PmenuSel ctermbg=lightblue ctermfg=black
|
|
|
|
"nnoremap <F3> :YcmCompleter GetDoc<CR>
|
|
"nnoremap <F4> :<C-u>echo ""<CR>
|
|
"inoremap <silent> <C-a> <plug>(YCMCompleter)
|
|
"autocmd User YcmLoaded inoremap <silent> <C-a> <Plug>(YCMCompleter)
|
|
" How bad YCM developers had not thought about ADDING AN ABILITY TO MAP FUNCTIONS
|
|
imap <c-a> <c-space>
|
|
inoremap <C-q> <C-y>
|
|
nnoremap q <nop>
|
|
|
|
" For Airline
|
|
let g:airline_powerline_fonts = 1
|
|
let g:airline#extensions#keymap#enabled = 0
|
|
let g:airline_section_z = "\ue0a1:%l/%L Col:%c"
|
|
let g:Powerline_symbols='unicode'
|
|
|
|
" For NERDTree
|
|
let g:NERDTreeShowHidden=1
|
|
|
|
nnoremap <leader>i :NERDTree<CR><C-w>5>
|
|
nnoremap <leader>v :source $MYVIMRC<cr>
|
|
nnoremap <leader>e :vsplit $MYVIMRC<cr>
|
|
nnoremap <leader>w :set wrap<cr>:set linebreak<cr>
|
|
nnoremap <leader>y :call system("xclip -i -f -selection primary \| xclip -i -selection clipboard", getreg("@\""))<cr>
|
|
|
|
" Close the tab if NERDTree is the only window remaining in it.
|
|
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | call feedkeys(":quit\<CR>:\<BS>") | endif
|
|
|
|
" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree.
|
|
autocmd BufEnter * if winnr() == winnr('h') && bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
|
|
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
|
|
|
|
" Remap cursor movement keys in Normal mode
|
|
nnoremap j h
|
|
nnoremap k j
|
|
nnoremap l k
|
|
nnoremap ; l
|
|
nnoremap <C-j> <Left>
|
|
nnoremap <C-k> <Down>
|
|
nnoremap <C-l> <Up>
|
|
execute "nnoremap " . g:ctrl_semicolon_key_code . " <Right>"
|
|
|
|
" Remap cursor movement keys in Visual mode
|
|
vnoremap j h
|
|
vnoremap k j
|
|
vnoremap l k
|
|
vnoremap ; l
|
|
vnoremap <C-j> <Left>
|
|
vnoremap <C-k> <Down>
|
|
vnoremap <C-l> <Up>
|
|
execute "vnoremap " . g:ctrl_semicolon_key_code . " <Right>"
|
|
|
|
" Remap cursor movement keys in Select mode
|
|
snoremap j h
|
|
snoremap k j
|
|
snoremap l k
|
|
snoremap ; l
|
|
|
|
" Remap cursor movement keys in Operator-pending mode
|
|
onoremap j h
|
|
onoremap k j
|
|
onoremap l k
|
|
onoremap ; l
|
|
|
|
" Remap cursor movement keys in Insert mode
|
|
inoremap <C-j> <Left>
|
|
inoremap <C-k> <Down>
|
|
inoremap <C-l> <Up>
|
|
execute "inoremap " . g:ctrl_semicolon_key_code . " <Right>"
|
|
|
|
" Remap cursor movement keys in Command-line mode
|
|
cnoremap <C-j> <Left>
|
|
cnoremap <C-k> <Down>
|
|
cnoremap <C-l> <Up>
|
|
execute "cnoremap " . g:ctrl_semicolon_key_code . " <Right>"
|
|
|
|
"Remap window movement
|
|
nnoremap <C-w>j <C-w>h
|
|
nnoremap <C-w>k <C-w>j
|
|
nnoremap <C-w>l <C-w>k
|
|
nnoremap <C-w>; <C-w>l
|
|
|
|
" My custom idea - moving window with the cursor
|
|
nnoremap K j<C-e>
|
|
nnoremap L k<C-y>
|
|
|
|
"Navigating tabs
|
|
nnoremap <C-t>j gT
|
|
nnoremap <C-t>; gt
|
|
|
|
"Rearranging tabs
|
|
nnoremap <C-t>J :tabmove -1<cr>
|
|
nnoremap <C-t>: :tabmove +1<cr>
|
|
|
|
|
|
"Makefile tab highlight
|
|
augroup MakefileTabHighlight
|
|
autocmd!
|
|
"autocmd FileType make syntax match FirstTab /^\t/
|
|
"autocmd FileType make highlight FirstTab ctermbg=35 ctermfg=35
|
|
autocmd FileType make setlocal noexpandtab
|
|
autocmd FileType make setlocal list
|
|
autocmd FileType make setlocal lcs=tab:*\ \*
|
|
autocmd FileType make highlight SpecialKey ctermbg=35 ctermfg=30
|
|
augroup END
|
|
|