Server-Dotfiles/vim/.vimrc

105 lines
2.4 KiB
VimL

set number
set modeline
set modelines=5
if &term =~ '^screen'
" tmux will send xterm-style keys when its xterm-keys option is on
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
endif
set hlsearch
set noexpandtab
set tabstop=4
set shiftwidth=4
set softtabstop=0
set wildmode=full
set mouse=
set foldmethod=indent
set foldlevelstart=99
set cursorcolumn
set cursorline
imap kj <ESC><ESC>
set undodir=~/.vim/undodir
set undofile
" Vim Plug "
call plug#begin('~/.vim/plugged')
Plug 'valloric/MatchTagAlways'
Plug 'tyru/caw.vim'
Plug 'jiangmiao/auto-pairs'
" For func argument completion
Plug 'christoomey/vim-conflicted'
Plug 'yggdroot/indentline'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'cespare/vim-toml'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'tpope/vim-surround'
Plug 'thanethomson/vim-jenkinsfile'
Plug 'vim-scripts/indentpython.vim'
Plug 'simnalamburt/vim-mundo'
Plug 'tpope/vim-unimpaired'
call plug#end()
autocmd BufWritePre * %s/\s\+$//e
autocmd FileType markdown setlocal formatoptions+=at
nnoremap <C-f> :noh<CR>
inoremap <C-f> <Esc>:noh<CR>i
nnoremap - :e.<CR>
nnoremap dA d$
nnoremap Y y$
map <C-k> gcc
imap <C-k> <Esc>gcci
nnoremap <C-w>' :vsp<CR><C-w>l:e.<CR>:CtrlP<CR>
inoremap <C-w>' <ESC>:vsp<CR><C-w>l:e.<CR>:CtrlP<CR>
nnoremap <C-w>" :sp<CR><C-w>j:e.<CR>:CtrlP<CR>
inoremap <C-w>" <ESC>:sp<CR><C-w>j:e.<CR>:CtrlP<CR>
nnoremap <C-w>g :vsp<CR>
inoremap <C-w>g <ESC>:vsp<CR>
nnoremap <C-w>G :sp<CR>
inoremap <C-w>G <ESC>:sp<CR>
nnoremap <C-,> :ll<CR>:lprevious<CR>
nnoremap <C-.> :ll<CR>:lnext<CR>
nnoremap <Tab> :tabnext<CR>
nnoremap <S-Tab> :tabprevious<CR>
nnoremap <C-t> :tabnew<CR>
nnoremap <C-T> :tabnew<CR>:e.<CR>
nnoremap ; :
iabbrev <// </<C-X><C-O>
let g:indentLine_char = '|'
set colorcolumn=80
colorscheme Tomorrow-Night-Bright
let g:netrw_banner=0
let g:airline_theme='wombat'
let g:airline#extensions#tabline#enabled = 1
" Ignore files in .gitignore
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
" Toggle spell checking on and off with `,s`
let mapleader = ","
nmap <silent> <leader>s :set spell!<CR>
nmap <leader>u :MundoToggle<CR>
" Restore cursor position
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif