136 lines
3.8 KiB
VimL
136 lines
3.8 KiB
VimL
""
|
||
"" Environment
|
||
""
|
||
|
||
" Vim environment
|
||
set directory=$XDG_CACHE_HOME/vim,~/,/tmp
|
||
set backupdir=$XDG_CACHE_HOME/vim,~/,/tmp
|
||
set viminfo+=n$XDG_CACHE_HOME/vim/viminfo
|
||
set rtp=$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIM,$VIMRUNTIME
|
||
let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc"
|
||
|
||
" Ctags data
|
||
set tags=$XDG_CACHE_HOME/vim/tags
|
||
|
||
" Keep history
|
||
set undodir=$XDG_CACHE_HOME/vim/undo
|
||
set undofile
|
||
|
||
|
||
""
|
||
"" Options
|
||
""
|
||
|
||
set nocompatible " Disable vi compatibility
|
||
set backspace=2 " Fix DEL in the terminal
|
||
set hidden " Hide buffers
|
||
set incsearch " Incremental search
|
||
set hlsearch " Highlight search results
|
||
|
||
set ignorecase " Case insensitive search...
|
||
set smartcase " ...for lowercase terms
|
||
set laststatus=2 "
|
||
|
||
set mouse=a " Enable mouse support
|
||
set showcmd " Show command while writing it
|
||
set ruler " Show line/column position
|
||
set novb " Disable visual beep
|
||
|
||
set nobackup " Disable ~backup
|
||
set noswapfile " Disable swap files
|
||
set writebackup " Enable temp backups
|
||
|
||
set wildmenu " Enable cmd autocompletion
|
||
set encoding=utf-8 " Default encoding
|
||
set nomodeline " Security
|
||
set tabpagemax=10 " Limit number of tabs to 10
|
||
set showmatch " Highlight matched parenthesis
|
||
set ffs=unix " Use UNIX file format
|
||
set clipboard=unnamed " Clipboard integration
|
||
set ttyfast " Improve redrawing in xterm
|
||
filetype indent plugin on " Identify file type
|
||
set wildignore+=*/tmp/*,*.so,*.swp " Files to ignore
|
||
|
||
set shiftwidth=4 " Tab
|
||
set tabstop=4 "
|
||
set noexpandtab "
|
||
|
||
set number " Line numbering
|
||
set autoindent " Indentation
|
||
set smartindent "
|
||
set noshowmode "
|
||
|
||
syntax on " Syntax highlighting
|
||
source $XDG_CONFIG_HOME/vim/colors.vim
|
||
|
||
|
||
" Titlebar without “-VIM”
|
||
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)
|
||
|
||
|
||
""
|
||
"" Key bindings
|
||
""
|
||
|
||
" Windows navigation
|
||
map <C-k> <C-w><Up>
|
||
map <C-j> <C-w><Down>
|
||
map <C-l> <C-w><Right>
|
||
map <C-h> <C-w><Left>
|
||
|
||
map <C-t> :TagbarToggle<CR>
|
||
|
||
|
||
""
|
||
"" Plugins
|
||
""
|
||
|
||
set rtp+=$XDG_CACHE_HOME/vim/plugins/Vundle.vim
|
||
call vundle#begin('$XDG_CACHE_HOME/vim/plugins')
|
||
|
||
Plugin 'VundleVim/Vundle.vim'
|
||
Plugin 'kien/ctrlp.vim'
|
||
Plugin 'itchyny/lightline.vim'
|
||
Plugin 'townk/vim-autoclose'
|
||
Plugin 'tpope/vim-fugitive'
|
||
Plugin 'travitch/hasksyn'
|
||
Plugin 'tpope/vim-markdown'
|
||
Plugin 'jgertm/nix.vim'
|
||
Plugin 'ervandew/supertab'
|
||
Plugin 'majutsushi/tagbar'
|
||
Plugin 'scrooloose/syntastic'
|
||
|
||
call vundle#end()
|
||
|
||
|
||
""
|
||
"" Plugin options
|
||
""
|
||
|
||
" Lightline
|
||
source $XDG_CONFIG_HOME/vim/lightline.vim
|
||
|
||
" Syntastic
|
||
let g:syntastic_check_on_open = 1
|
||
let g:syntastic_enable_signs = 1
|
||
let g:syntastic_python_checkers = ["flake8", "python"]
|
||
let g:syntastic_python_python_exe = 'python3'
|
||
|
||
" Tagbar
|
||
let g:tagbar_status_func = "TagbarStatusFunc"
|
||
let g:tagbar_compact = 1
|
||
let g:tagbar_iconchars = [">", "∨"]
|
||
|
||
" MiniBufferExplorer
|
||
let g:miniBufExplMapWindowNavVim = 1
|
||
let g:miniBufExplMapWindowNavArrows = 1
|
||
let g:miniBufExplMapCTabSwitchBufs = 1
|
||
let g:miniBufExplModSelTarget = 1
|
||
|
||
" CtrlP
|
||
let g:ctrlp_clear_cache_on_exit = 0
|
||
let g:ctrlp_custom_ignore = {"dir": "\v[\/]\.(git|hg|svn|ve)$"}
|
||
let g:ctrlp_status_func = {"main": "CtrlPStatusMain",
|
||
\"prog": "CtrlPStatusProg"}
|
||
|