481 lines
12 KiB
VimL
481 lines
12 KiB
VimL
" ===== hasufell's vimrc ))))
|
|
|
|
|
|
" plugin stuff
|
|
filetype plugin on
|
|
filetype indent on
|
|
|
|
|
|
|
|
" vim-plug settings (Plugin declaration)
|
|
call plug#begin('~/.vim/plugged')
|
|
|
|
Plug 'mileszs/ack.vim'
|
|
Plug 'romainl/Apprentice'
|
|
Plug 'chriskempson/base16-vim'
|
|
Plug 'fneu/breezy'
|
|
Plug 'vim-scripts/cmdalias.vim'
|
|
Plug 'Raimondi/delimitMate'
|
|
Plug 'romainl/Disciple'
|
|
Plug 'vim-scripts/genindent.vim'
|
|
Plug 'sjl/gundo.vim'
|
|
Plug 'idris-hackers/idris-vim'
|
|
Plug 'wimstefan/Lightning'
|
|
Plug 'yegappan/mru'
|
|
Plug 'scrooloose/nerdcommenter'
|
|
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
|
Plug 'NLKNguyen/papercolor-theme'
|
|
Plug 'vim-scripts/promela.vim'
|
|
Plug 'AndrewRadev/simple_bookmarks.vim'
|
|
Plug 'Keithbsmiley/swift.vim'
|
|
Plug 'majutsushi/tagbar'
|
|
Plug 'ternjs/tern_for_vim'
|
|
Plug 'flazz/vim-colorschemes'
|
|
Plug 'reedes/vim-colors-pencil'
|
|
Plug 'altercation/vim-colors-solarized'
|
|
Plug 'xolox/vim-easytags'
|
|
Plug 'tpope/vim-fugitive'
|
|
Plug 'whatyouhide/vim-gotham'
|
|
Plug 'noahfrederick/vim-hemisu'
|
|
Plug 'nathanaelkane/vim-indent-guides'
|
|
Plug 'xolox/vim-misc'
|
|
Plug 'Shougo/vimproc.vim', {'do' : 'make'}
|
|
Plug 'tpope/vim-rhubarb'
|
|
Plug 'sjbach/lusty'
|
|
if has("nvim")
|
|
Plug 'iCyMind/NeoSolarized'
|
|
endif
|
|
Plug 'vim-airline/vim-airline'
|
|
Plug 'vim-airline/vim-airline-themes'
|
|
|
|
" local_vimrc
|
|
Plug 'LucHermitte/lh-vim-lib'
|
|
Plug 'LucHermitte/local_vimrc'
|
|
|
|
" completion
|
|
Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clang-completer --go-completer --rust-completer --system-boost --system-libclang',
|
|
\ 'for': ['c', 'python', 'sh', 'go', 'clojure'],
|
|
\ }
|
|
" deoplete for haskell
|
|
if has('nvim')
|
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins',
|
|
\ }
|
|
else
|
|
Plug 'Shougo/deoplete.nvim'
|
|
Plug 'roxma/nvim-yarp'
|
|
Plug 'roxma/vim-hug-neovim-rpc'
|
|
endif
|
|
|
|
" snippets
|
|
Plug 'Shougo/neosnippet.vim'
|
|
Plug 'honza/vim-snippets'
|
|
|
|
" LSP
|
|
" setting this per-language breaks "let g:LanguageClient_autoStart = 1",
|
|
Plug 'autozimu/LanguageClient-neovim', {
|
|
\ 'branch': 'next',
|
|
\ 'do': 'bash install.sh',
|
|
\ }
|
|
" (Optional) Multi-entry selection UI.
|
|
Plug 'junegunn/fzf', { 'for': 'haskell' }
|
|
|
|
" linting/compilation
|
|
Plug 'w0rp/ale', {
|
|
\ 'do': 'bash -c \"cp -R ~/.vim/ale_linters .\"',
|
|
\ }
|
|
|
|
" haskell
|
|
" if has("nvim")
|
|
" Plug 'parsonsmatt/intero-neovim'
|
|
" endif
|
|
Plug 'eagletmt/ghcmod-vim', { 'for': 'haskell' }
|
|
" completion based on ghc-mod, not LSP
|
|
" Plug 'eagletmt/neco-ghc', { 'for': 'haskell' }
|
|
Plug 'lukerandall/haskellmode-vim', { 'for': 'haskell' }
|
|
Plug 'neovimhaskell/haskell-vim', { 'for': ['haskell', 'cabal'] }
|
|
Plug 'ucsd-progsys/liquid-types.vim', { 'for': 'haskell' }
|
|
Plug 'bitc/lushtags', {
|
|
\ 'do': 'bash -c \"cabal clean && cabal sandbox delete && cabal sandbox init && cabal install && cp .cabal-sandbox/bin/lushtags ~/.cabal/bin/lushtags\"',
|
|
\ 'for': 'haskell',
|
|
\ }
|
|
" Plug 'timmytofu/vim-cabal-context', { 'for': 'haskell' }
|
|
Plug 'itchyny/vim-haskell-indent', { 'for': 'haskell' }
|
|
Plug 'dan-t/vim-hsimport', { 'for': 'haskell' }
|
|
|
|
" clojure
|
|
" Plug '~/.vim/unmanaged-vim-plug/paredit', { 'for': 'clojure' }
|
|
" Plug '~/.vim/unmanaged-vim-plug/tslime', { 'for': 'clojure' }
|
|
Plug 'guns/vim-slamhound', {'for': 'clojure'}
|
|
Plug 'guns/vim-sexp', {'for': 'clojure'}
|
|
Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'}
|
|
Plug 'kovisoft/paredit', {'for': 'clojure'}
|
|
Plug 'tpope/vim-salve', { 'for': 'clojure' }
|
|
Plug 'tpope/vim-projectionist', { 'for': 'clojure' }
|
|
Plug 'tpope/vim-dispatch', { 'for': 'clojure' }
|
|
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
|
|
Plug 'luochen1990/rainbow', { 'for': 'clojure' }
|
|
Plug 'typedclojure/vim-typedclojure', {'for': 'clojure'}
|
|
|
|
|
|
" go
|
|
Plug 'garyburd/go-explorer', { 'for': 'go' }
|
|
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries', 'for': 'go' }
|
|
|
|
" rust
|
|
Plug 'rhysd/rust-doc.vim', { 'for': 'rust' }
|
|
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
|
|
|
|
" javascript
|
|
Plug 'moll/vim-node', { 'for': 'javascript' }
|
|
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
|
|
|
|
" python
|
|
Plug 'icedwater/vimpython', { 'for': 'python' }
|
|
|
|
" scala
|
|
Plug 'derekwyatt/vim-scala', { 'for': 'scala' }
|
|
|
|
" unmanaged
|
|
Plug '~/.vim/unmanaged-vim-plug/bufonly'
|
|
Plug '~/.vim/unmanaged-vim-plug/colorschemedegrade'
|
|
Plug '~/.vim/unmanaged-vim-plug/fuzzyfinder'
|
|
Plug '~/.vim/unmanaged-vim-plug/L9'
|
|
Plug '~/.vim/unmanaged-vim-plug/log'
|
|
Plug '~/.vim/unmanaged-vim-plug/ScrollColor'
|
|
Plug '~/.vim/unmanaged-vim-plug/txtfmt'
|
|
if !has("nvim")
|
|
Plug '~/.vim/unmanaged-vim-plug/fontzoom'
|
|
endif
|
|
|
|
|
|
" Initialize plugin system
|
|
call plug#end()
|
|
|
|
|
|
" ===== further plugin initialization and default config =====
|
|
so ~/.vim/plugged/cmdalias.vim/plugin/cmdalias.vim
|
|
|
|
|
|
if !has("nvim")
|
|
"powerline
|
|
python3 from powerline.vim import setup as powerline_setup
|
|
python3 powerline_setup()
|
|
python3 del powerline_setup
|
|
set laststatus=2
|
|
|
|
" lj
|
|
let g:LustyJugglerSuppressRubyWarning = 1
|
|
endif
|
|
|
|
" lustyexplorer
|
|
set hidden
|
|
|
|
|
|
" neosnippet
|
|
" Plugin key-mappings.
|
|
" Note: It must be "imap" and "smap". It uses <Plug> mappings.
|
|
imap <C-k> <Plug>(neosnippet_expand_or_jump)
|
|
smap <C-k> <Plug>(neosnippet_expand_or_jump)
|
|
xmap <C-k> <Plug>(neosnippet_expand_target)
|
|
|
|
" SuperTab like snippets behavior.
|
|
" Note: It must be "imap" and "smap". It uses <Plug> mappings.
|
|
imap <expr><tab> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "\<c-n>" : "\<tab>"
|
|
smap <expr><tab> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<tab>"
|
|
|
|
" For conceal markers.
|
|
if has('conceal')
|
|
set conceallevel=2 concealcursor=niv
|
|
endif
|
|
" Enable snipMate compatibility feature.
|
|
let g:neosnippet#enable_snipmate_compatibility = 1
|
|
|
|
|
|
" vim airline
|
|
" let g:airline#extensions#tabline#enabled = 1
|
|
|
|
|
|
" LSP
|
|
let g:LanguageClient_autoStart = 0
|
|
|
|
" deoplete
|
|
let g:deoplete#enable_at_startup = 0
|
|
|
|
" ==== delimitMate ====
|
|
let g:delimitMate_matchpairs = "(:),[:],{:}"
|
|
let g:delimitMate_expand_cr = 1
|
|
let g:delimitMate_expand_space = 1
|
|
let g:delimitMate_autoclose = 1
|
|
|
|
|
|
" Solarized stuff
|
|
" let g:solarized_termtrans=0
|
|
" let g:solarized_degrade=0
|
|
" let g:solarized_bold=1
|
|
" let g:solarized_underline=1
|
|
" let g:solarized_italic=1
|
|
" let g:solarized_termcolors=16
|
|
" let g:solarized_contrast="normal"
|
|
let g:solarized_visibility="high"
|
|
" let g:solarized_diffmode="normal"
|
|
" let g:solarized_hitrail=0
|
|
let g:solarized_menu=1
|
|
|
|
|
|
" youcompleteme
|
|
let g:ycm_filetype_blacklist = {
|
|
\ 'notes' : 1,
|
|
\ 'markdown' : 1,
|
|
\ 'text' : 1,
|
|
\ 'java' : 1,
|
|
\}
|
|
let g:ycm_confirm_extra_conf = 0
|
|
let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'
|
|
let g:ycm_collect_identifiers_from_tags_files = 1
|
|
let g:ycm_seed_identifiers_with_syntax = 0
|
|
" let g:ycm_always_populate_location_list = 1
|
|
let g:ycm_autoclose_preview_window_after_completion = 1
|
|
let g:ycm_key_invoke_completion = '<C-Space>'
|
|
let g:ycm_key_list_select_completion = ['<TAB>']
|
|
let g:ycm_key_list_previous_completion = ['<S-TAB>']
|
|
" nnoremap <F4> :YcmCompleter GoToDefinition<CR>
|
|
let g:ycm_server_log_level = 'error'
|
|
let g:ycm_semantic_triggers = {'haskell' : ['. ', '$ ']}
|
|
let g:ycm_goto_buffer_command = 'horizontal-split'
|
|
|
|
|
|
" commenting
|
|
let NERDSpaceDelims=1
|
|
let NERDCreateDefaultMappings=0
|
|
|
|
" haskellmode, needs to load early
|
|
let g:haddock_browser='/usr/bin/firefox'
|
|
let g:haddock_browser_callformat='%s file://%s >/dev/null 2>&1 &'
|
|
|
|
|
|
" ==== conque ====
|
|
" command aliases
|
|
call CmdAlias('t','tabnew')
|
|
" call CmdAlias('cmd','ConqueTermSplit')
|
|
" call CmdAlias('bash','ConqueTermSplit bash<CR>')
|
|
call CmdAlias('openall','tab sball')
|
|
call CmdAlias('stripw','call StripTrailingWhitespaces()<CR>')
|
|
call CmdAlias('hotkeys', 'tabnew ~/.vim/hotkeys')
|
|
call CmdAlias('TC', 'call ToggleComment()<CR>')
|
|
call CmdAlias('TF', 'call ToggleFoldText()<CR>')
|
|
call CmdAlias('ctags', '!/usr/bin/ctags -R --langmap=c:.c.h --c++-kinds=+p --c-kinds=+p+x --fields=+i+a+S+t+l+m+n --extra=+q .<CR>')
|
|
|
|
|
|
|
|
" global settings
|
|
set foldmethod=syntax "fold based on indent
|
|
set foldnestmax=10 "deepest fold is 10 levels
|
|
set nofoldenable "dont fold by default
|
|
set foldlevel=1 "this is just what i useset directory=~/.vimtmp
|
|
set mouse=a
|
|
set autoread
|
|
set number
|
|
set encoding=utf8
|
|
set guifont=Monospace\ 14
|
|
set clipboard=unnamedplus
|
|
set textwidth=0
|
|
set tabstop=4
|
|
set shiftwidth=4
|
|
set directory=~/.vimtmp
|
|
set modeline
|
|
set modelines=1
|
|
|
|
let g:nickID = "hasufell"
|
|
|
|
" don't yank to buffer on deletion
|
|
" vnoremap d "_d
|
|
" nnoremap d "_d
|
|
vnoremap x "_x
|
|
nnoremap x "_x
|
|
|
|
" Syntax
|
|
syntax on
|
|
|
|
" pane navigation
|
|
" Use ctrl-[hjkl] to select the active split!
|
|
let g:C_Ctrl_j = 'off'
|
|
let g:BASH_Ctrl_j = 'off'
|
|
|
|
try
|
|
lang en_US
|
|
catch
|
|
endtry
|
|
|
|
" ==========colors===========
|
|
"set t_Co=256
|
|
"let g:solarized_termcolors=256
|
|
if has('gui_running')
|
|
set background=dark
|
|
colorscheme solarized
|
|
else
|
|
set background=dark
|
|
colorscheme solarized
|
|
endif
|
|
|
|
if has("nvim")
|
|
if exists('g:GtkGuiLoaded')
|
|
let g:neosolarized_contrast = "normal"
|
|
let g:neosolarized_visibility = "normal"
|
|
let g:neosolarized_vertSplitBgTrans = 0
|
|
let g:neosolarized_bold = 1
|
|
let g:neosolarized_underline = 1
|
|
let g:neosolarized_italic = 1
|
|
set background=dark
|
|
colorscheme NeoSolarized
|
|
else
|
|
let g:neosolarized_contrast = "normal"
|
|
let g:neosolarized_visibility = "normal"
|
|
let g:neosolarized_vertSplitBgTrans = 0
|
|
let g:neosolarized_bold = 1
|
|
let g:neosolarized_underline = 1
|
|
let g:neosolarized_italic = 1
|
|
set background=dark
|
|
colorscheme NeoSolarized
|
|
endif
|
|
endif
|
|
|
|
" ===========================
|
|
|
|
|
|
|
|
|
|
|
|
" Disable annoying auto line break
|
|
fu! DisableBr()
|
|
set wrap
|
|
set linebreak
|
|
set nolist " list disables linebreak
|
|
set textwidth=0
|
|
set wrapmargin=0
|
|
set fo-=t
|
|
endfu
|
|
|
|
" Disable line breaks for all file types
|
|
au BufNewFile,BufRead *.* call DisableBr()
|
|
|
|
|
|
" ==========copy/paste===========
|
|
function! Paste(mode)
|
|
if a:mode == "v"
|
|
normal gv
|
|
normal "_d
|
|
normal "+gP
|
|
normal l
|
|
elseif a:mode == "i"
|
|
set virtualedit=all
|
|
normal `^"+gP
|
|
let &virtualedit = ""
|
|
endif
|
|
endfunction
|
|
|
|
|
|
" ======select all=======
|
|
function! Select()
|
|
set virtualedit=all
|
|
normal `^ggVG
|
|
let &virtualedit = ""
|
|
endfunction
|
|
" =======================
|
|
|
|
|
|
|
|
" ====== traling whitespace =====
|
|
fun! ShowTrailingWhitespace(pattern)
|
|
if &ft == 'conque_term'
|
|
call clearmatches()
|
|
return
|
|
endif
|
|
if &ft == 'diff'
|
|
call clearmatches()
|
|
return
|
|
endif
|
|
let str=a:pattern
|
|
if str == '1'
|
|
match ExtraWhitespace /\s\+$/
|
|
elseif str == '2'
|
|
call clearmatches()
|
|
" match ExtraWhitespace /\s\+\%#\@<!$/
|
|
elseif str == '3'
|
|
match ExtraWhitespace /\s\+$/
|
|
endif
|
|
endfun
|
|
|
|
|
|
highlight ExtraWhitespace ctermbg=red guibg=red
|
|
match ExtraWhitespace /\s\+$/
|
|
autocmd BufWinEnter * call ShowTrailingWhitespace('1')
|
|
autocmd InsertEnter * call ShowTrailingWhitespace('2')
|
|
autocmd InsertLeave * call ShowTrailingWhitespace('3')
|
|
autocmd BufWinLeave * call clearmatches()
|
|
|
|
|
|
fun! StripTrailingWhitespaces()
|
|
let l = line(".")
|
|
let c = col(".")
|
|
%s/\s\+$//e
|
|
call cursor(l, c)
|
|
endfun
|
|
|
|
|
|
" ===========================
|
|
|
|
|
|
" comment hiding
|
|
func! IsComment( lnum )
|
|
return synIDattr(synID(a:lnum, match(getline(a:lnum),'\S')+1, 1),"name") =~? 'comment'
|
|
endfun
|
|
|
|
|
|
"set fdm=expr
|
|
set fde=IsComment(v:lnum)?1:IsComment(prevnonblank(v:lnum))?1:IsComment(nextnonblank\(v:lnum))?1:0
|
|
|
|
|
|
" light #073642 dark #002b36 grey #586e75
|
|
highlight Folded gui=NONE guifg=#586e75 guibg=#002b36
|
|
set foldtext='\ '
|
|
|
|
|
|
let g:folded = 0
|
|
function! ToggleComment()
|
|
if (g:folded == 0)
|
|
highlight Comment guifg=#002b36
|
|
let g:folded=1
|
|
else
|
|
highlight Comment guifg=#586e75
|
|
let g:folded=0
|
|
endif
|
|
endfunction
|
|
|
|
|
|
let g:myfoldtext = 0
|
|
function! ToggleFoldText()
|
|
if (g:myfoldtext == 0)
|
|
set foldtext='--'.v:folddashes.'\ '.getline(v:foldstart).'\ '
|
|
let g:myfoldtext=1
|
|
else
|
|
set foldtext='\ '
|
|
let g:myfoldtext=0
|
|
endif
|
|
endfunction
|
|
|
|
|
|
""""""""""""""""""""""""""""""
|
|
" vim macro to jump to devhelp topics.
|
|
""""""""""""""""""""""""""""""
|
|
function! DevHelpCurrentWord()
|
|
let word = expand("<cword>")
|
|
exe "!devhelp -s " . word . " &"
|
|
endfunction
|
|
|
|
function! ManCurrentWord()
|
|
let word = expand("<cword>")
|
|
exe "!man 3 " . word
|
|
endfunction
|
|
|
|
" vim:foldmethod=marker:foldlevel=0
|