2019-07-29 11:10:24 +02:00
|
|
|
source ~/.vim/vundlerc.vim
|
|
|
|
|
|
|
|
syntax on
|
|
|
|
filetype plugin indent on
|
|
|
|
set omnifunc=syntaxcomplete#Complete
|
|
|
|
|
|
|
|
" unset mouse
|
|
|
|
set mouse=
|
|
|
|
|
2019-07-31 21:26:30 +02:00
|
|
|
" Maintain undo history between sessions
|
|
|
|
if !isdirectory("/tmp/.vim-undo-dir")
|
|
|
|
call mkdir("/tmp/.vim-undo-dir", "", 0700)
|
|
|
|
endif
|
|
|
|
set undodir=/tmp/.vim-undo-dir
|
|
|
|
set undofile
|
|
|
|
|
2019-07-29 11:10:24 +02:00
|
|
|
" Default tab is 4 spaces
|
|
|
|
set tabstop=4
|
|
|
|
set softtabstop=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set expandtab
|
|
|
|
|
2019-10-22 22:54:19 +02:00
|
|
|
|
|
|
|
set wildignorecase " Ignore case in command completion
|
|
|
|
set laststatus=2 " Always show statusline
|
|
|
|
|
|
|
|
" Search settings
|
|
|
|
set smartcase " If an uppercase letter is the query, be case sensitive
|
|
|
|
set incsearch " Highlight matches while typing query
|
|
|
|
set hlsearch " Highlight all search matches
|
|
|
|
|
|
|
|
" Highlight matching brackets
|
2019-07-29 11:10:24 +02:00
|
|
|
set showmatch
|
2019-10-22 22:54:19 +02:00
|
|
|
set mps+=<:> " Also, match < and >
|
2019-07-29 11:10:24 +02:00
|
|
|
|
|
|
|
" Use TAB to switch between buffers
|
|
|
|
noremap <tab> :bn<CR>
|
|
|
|
noremap <S-tab> :bp<CR>
|
|
|
|
|
2019-10-22 22:54:19 +02:00
|
|
|
" Trailing whitespace - highlight in darker red, clean buffer with Ctrl+k
|
2019-08-02 17:21:15 +02:00
|
|
|
highlight WhitespaceEOL ctermbg=red guibg=#ab0d0d
|
2019-07-29 11:10:24 +02:00
|
|
|
match WhitespaceEOL /\s\+\%#\@<!$/
|
|
|
|
nnoremap <C-k> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>
|
2019-07-31 21:18:12 +02:00
|
|
|
|
2019-08-02 17:21:15 +02:00
|
|
|
" Much better with Tomorrow Night Bright color theme set in alacritty
|
2019-08-02 22:36:04 +02:00
|
|
|
set background=dark
|
|
|
|
highlight Search ctermfg=Black
|
|
|
|
highlight Comment ctermfg=Grey
|
2019-08-02 17:21:15 +02:00
|
|
|
highlight SignColumn ctermbg=236
|
2019-08-02 22:36:04 +02:00
|
|
|
highlight LineNr ctermfg=244
|
|
|
|
highlight LineNr ctermbg=232
|
|
|
|
highlight Folded ctermbg=DarkGreen
|
|
|
|
highlight Folded ctermfg=Black
|
2019-08-02 17:21:15 +02:00
|
|
|
|
2019-08-02 11:41:58 +02:00
|
|
|
" Language indents and line lengths
|
2019-08-25 18:59:39 +02:00
|
|
|
autocmd FileType py,rst,md set textwidth=79
|
|
|
|
autocmd FileType html,yaml,css set softtabstop=2 shiftwidth=2
|
2019-07-31 21:18:12 +02:00
|
|
|
|
2019-07-29 11:10:24 +02:00
|
|
|
" Toggles on different plugins/modes
|
|
|
|
noremap <F1> :ToggleMouse<CR>
|
|
|
|
inoremap <F1> <Esc>:ToggleMouse<CR>a
|
|
|
|
nmap <F3> :set nonumber!<CR>
|
|
|
|
nmap <F5> :NERDTreeToggle<CR>
|
|
|
|
set pastetoggle=<F2>
|
|
|
|
|
2019-10-22 22:54:19 +02:00
|
|
|
" Enable vimrc files per project
|
2019-07-29 11:10:24 +02:00
|
|
|
set exrc
|
|
|
|
" Disable unsafe commands in project vimrc
|
|
|
|
set secure
|