all: clean up everything
This commit is contained in:
167
vimrc
167
vimrc
@@ -1,9 +1,5 @@
|
||||
" General {{{
|
||||
|
||||
if has('python3')
|
||||
silent! python3 1
|
||||
endif
|
||||
|
||||
" use indentation for folds
|
||||
set foldmethod=indent
|
||||
set foldnestmax=5
|
||||
@@ -34,9 +30,6 @@ set formatprg="PARINIT='rTbgqR B=.,?_A_a Q=_s>|' par\ -w72"
|
||||
" Use stylish haskell instead of par for haskell buffers
|
||||
autocmd FileType haskell let &formatprg="stylish-haskell"
|
||||
|
||||
" Find custom built ghc-mod, codex etc
|
||||
let $PATH = $PATH . ':' . expand("~/.haskell-vim-now/bin")
|
||||
|
||||
" Kill the damned Ex mode.
|
||||
nnoremap Q <nop>
|
||||
|
||||
@@ -90,16 +83,11 @@ Bundle 'eagletmt/neco-ghc'
|
||||
Bundle 'Twinside/vim-hoogle'
|
||||
|
||||
" Other programming languages
|
||||
Bundle 'digitaltoad/vim-jade'
|
||||
Bundle 'zepto-lang/zepto-vim'
|
||||
Bundle 'hellerve/carp-vim'
|
||||
Bundle 'hellerve/luna-vim'
|
||||
Bundle 'tikhomirov/vim-glsl'
|
||||
Plugin 'rust-lang/rust.vim'
|
||||
Plugin 'kchmck/vim-coffee-script'
|
||||
Plugin 'isRuslan/vim-es6'
|
||||
Plugin 'zig-lang/zig.vim'
|
||||
Plugin 'tpope/vim-fireplace'
|
||||
|
||||
" Extra
|
||||
Plugin 'editorconfig/editorconfig-vim'
|
||||
@@ -141,7 +129,7 @@ set whichwrap+=<,>,h,l
|
||||
" Ignore case when searching
|
||||
set ignorecase
|
||||
|
||||
" When searching try to be smart about cases
|
||||
" When searching try to be smart about cases
|
||||
set smartcase
|
||||
|
||||
" Highlight search results
|
||||
@@ -258,11 +246,6 @@ augroup sourcing
|
||||
autocmd bufwritepost .vimrc source $MYVIMRC
|
||||
augroup END
|
||||
|
||||
" Map Ctrl-S to save
|
||||
noremap <silent> <C-S> :update<CR>
|
||||
vnoremap <silent> <C-S> <C-C>:update<CR>
|
||||
inoremap <silent> <C-S> <C-O>:update<CR>
|
||||
|
||||
" Open file prompt with current path
|
||||
nmap <leader>e :e <C-R>=expand("%:p:h") . '/'<CR>
|
||||
|
||||
@@ -323,15 +306,6 @@ noremap <c-k> <c-w>k
|
||||
noremap <c-j> <c-w>j
|
||||
noremap <c-l> <c-w>l
|
||||
|
||||
" Disable highlight when <leader><cr> is pressed
|
||||
" but preserve cursor coloring
|
||||
nmap <silent> <leader><cr> :noh\|hi Cursor guibg=red<cr>
|
||||
augroup haskell
|
||||
autocmd!
|
||||
autocmd FileType haskell map <silent> <leader><cr> :noh<cr>:GhcModTypeClear<cr>:SyntasticReset<cr>
|
||||
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
|
||||
augroup END
|
||||
|
||||
" Return to last edit position when opening files (You want this!)
|
||||
augroup last_edit
|
||||
autocmd!
|
||||
@@ -343,33 +317,9 @@ augroup END
|
||||
" Remember info about open buffers on close
|
||||
set viminfo^=%
|
||||
|
||||
" Open window splits in various places
|
||||
nmap <leader>sh :leftabove vnew<CR>
|
||||
nmap <leader>sl :rightbelow vnew<CR>
|
||||
nmap <leader>sk :leftabove new<CR>
|
||||
nmap <leader>sj :rightbelow new<CR>
|
||||
|
||||
" Manually create key mappings (to avoid rebinding C-\)
|
||||
let g:tmux_navigator_no_mappings = 1
|
||||
|
||||
nnoremap <silent> <C-h> :TmuxNavigateLeft<cr>
|
||||
nnoremap <silent> <C-j> :TmuxNavigateDown<cr>
|
||||
nnoremap <silent> <C-k> :TmuxNavigateUp<cr>
|
||||
nnoremap <silent> <C-l> :TmuxNavigateRight<cr>
|
||||
|
||||
" don't close buffers when you aren't displaying them
|
||||
set hidden
|
||||
|
||||
" previous buffer, next buffer
|
||||
nnoremap <leader>bp :bp<cr>
|
||||
nnoremap <leader>bn :bn<cr>
|
||||
|
||||
" delete buffer without closing pane
|
||||
noremap <leader>bd :Bd<cr>
|
||||
|
||||
" fuzzy find buffers
|
||||
noremap <leader>b<space> :CtrlPBuffer<cr>
|
||||
|
||||
" }}}
|
||||
|
||||
" Status line {{{
|
||||
@@ -433,14 +383,6 @@ endfunction
|
||||
|
||||
" }}}
|
||||
|
||||
" Slime {{{
|
||||
|
||||
vmap <silent> <Leader>rs <Plug>SendSelectionToTmux
|
||||
nmap <silent> <Leader>rs <Plug>NormalModeSendToTmux
|
||||
nmap <silent> <Leader>rv <Plug>SetTmuxVars
|
||||
|
||||
" }}}
|
||||
|
||||
" NERDTree {{{
|
||||
|
||||
" Close nerdtree after a file is selected
|
||||
@@ -486,60 +428,6 @@ let g:haskell_tabular = 1
|
||||
|
||||
set tags=tags;/,codex.tags;/
|
||||
|
||||
let g:tagbar_type_haskell = {
|
||||
\ 'ctagsbin' : 'hasktags',
|
||||
\ 'ctagsargs' : '-x -c -o-',
|
||||
\ 'kinds' : [
|
||||
\ 'm:modules:0:1',
|
||||
\ 'd:data: 0:1',
|
||||
\ 'd_gadt: data gadt:0:1',
|
||||
\ 't:type names:0:1',
|
||||
\ 'nt:new types:0:1',
|
||||
\ 'c:classes:0:1',
|
||||
\ 'cons:constructors:1:1',
|
||||
\ 'c_gadt:constructor gadt:1:1',
|
||||
\ 'c_a:constructor accessors:1:1',
|
||||
\ 'ft:function types:1:1',
|
||||
\ 'fi:function implementations:0:1',
|
||||
\ 'o:others:0:1'
|
||||
\ ],
|
||||
\ 'sro' : '.',
|
||||
\ 'kind2scope' : {
|
||||
\ 'm' : 'module',
|
||||
\ 'c' : 'class',
|
||||
\ 'd' : 'data',
|
||||
\ 't' : 'type'
|
||||
\ },
|
||||
\ 'scope2kind' : {
|
||||
\ 'module' : 'm',
|
||||
\ 'class' : 'c',
|
||||
\ 'data' : 'd',
|
||||
\ 'type' : 't'
|
||||
\ }
|
||||
\ }
|
||||
|
||||
" Generate haskell tags with codex and hscope
|
||||
map <leader>tg :!codex update --force<CR>:call system("git hscope -X TemplateHaskell")<CR><CR>:call LoadHscope()<CR>
|
||||
|
||||
map <leader>tt :TagbarToggle<CR>
|
||||
|
||||
set csprg=~/.haskell-vim-now/bin/hscope
|
||||
set csto=1 " search codex tags first
|
||||
set cst
|
||||
set csverb
|
||||
nnoremap <silent> <C-\> :cs find c <C-R>=expand("<cword>")<CR><CR>
|
||||
" Automatically make cscope connections
|
||||
function! LoadHscope()
|
||||
let db = findfile("hscope.out", ".;")
|
||||
if (!empty(db))
|
||||
let path = strpart(db, 0, match(db, "/hscope.out$"))
|
||||
set nocscopeverbose " suppress 'duplicate connection' error
|
||||
exe "cs add " . db . " " . path
|
||||
set cscopeverbose
|
||||
endif
|
||||
endfunction
|
||||
au BufEnter /*.hs call LoadHscope()
|
||||
|
||||
" }}}
|
||||
|
||||
" Git {{{
|
||||
@@ -554,13 +442,6 @@ function! NonintrusiveGitGrep(term)
|
||||
execute "redraw!"
|
||||
endfunction
|
||||
|
||||
command! -nargs=1 GGrep call NonintrusiveGitGrep(<q-args>)
|
||||
nmap <leader>gs :Gstatus<CR>
|
||||
nmap <leader>gg :copen<CR>:GGrep
|
||||
nmap <leader>gl :Extradite!<CR>
|
||||
nmap <leader>gd :Gdiff<CR>
|
||||
nmap <leader>gb :Gblame<CR>
|
||||
|
||||
function! CommittedFiles()
|
||||
" Clear quickfix list
|
||||
let qf_list = []
|
||||
@@ -574,9 +455,6 @@ function! CommittedFiles()
|
||||
call setqflist(qf_list, '')
|
||||
endfunction
|
||||
|
||||
" Show list of last-committed files
|
||||
nnoremap <silent> <leader>g? :call CommittedFiles()<CR>:copen<CR>
|
||||
|
||||
" }}}
|
||||
|
||||
" Haskell Interrogation {{{
|
||||
@@ -586,43 +464,10 @@ set completeopt+=longest
|
||||
" Use buffer words as default tab completion
|
||||
let g:SuperTabDefaultCompletionType = '<c-x><c-p>'
|
||||
|
||||
" But provide (neco-ghc) omnicompletion
|
||||
if has("gui_running")
|
||||
imap <c-space> <c-r>=SuperTabAlternateCompletion("\<lt>c-x>\<lt>c-o>")<cr>
|
||||
else " no gui
|
||||
if has("unix")
|
||||
inoremap <Nul> <c-r>=SuperTabAlternateCompletion("\<lt>c-x>\<lt>c-o>")<cr>
|
||||
endif
|
||||
endif
|
||||
|
||||
" Show types in completion suggestions
|
||||
let g:necoghc_enable_detailed_browse = 1
|
||||
|
||||
" Type of expression under cursor
|
||||
nmap <silent> <leader>ht :GhcModType<CR>
|
||||
" Insert type of expression under cursor
|
||||
nmap <silent> <leader>hT :GhcModTypeInsert<CR>
|
||||
" GHC errors and warnings
|
||||
nmap <silent> <leader>hc :SyntasticCheck ghc_mod<CR>
|
||||
" Haskell Lint
|
||||
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['haskell'] }
|
||||
nmap <silent> <leader>hl :SyntasticCheck hlint<CR>
|
||||
|
||||
" Hoogle the word under the cursor
|
||||
nnoremap <silent> <leader>hh :Hoogle<CR>
|
||||
|
||||
" Hoogle and prompt for input
|
||||
nnoremap <leader>hH :Hoogle
|
||||
|
||||
" Hoogle for detailed documentation (e.g. "Functor")
|
||||
nnoremap <silent> <leader>hi :HoogleInfo<CR>
|
||||
|
||||
" Hoogle for detailed documentation and prompt for input
|
||||
nnoremap <leader>hI :HoogleInfo
|
||||
|
||||
" Hoogle, close the Hoogle window
|
||||
nnoremap <silent> <leader>hz :HoogleClose<CR>
|
||||
|
||||
" }}}
|
||||
|
||||
" Conversion {{{
|
||||
@@ -639,13 +484,5 @@ vnoremap <silent> <leader>h> :call Pointful()<CR>
|
||||
|
||||
" }}}
|
||||
|
||||
" Customization {{{
|
||||
|
||||
if filereadable(expand("~/.vimrc.local"))
|
||||
source ~/.vimrc.local
|
||||
endif
|
||||
|
||||
" }}}
|
||||
|
||||
let g:syntastic_carp_checkers = ['carp']
|
||||
" command Cr !carp -x %
|
||||
command Cr !carp -x %
|
||||
|
Reference in New Issue
Block a user