vim: remove crud

This commit is contained in:
2019-03-12 13:36:38 +01:00
parent 33b0eed38a
commit 1c7e0f2480

182
vimrc
View File

@@ -1,12 +1,5 @@
" General {{{
" use indentation for folds
set foldmethod=indent
set foldnestmax=5
set foldlevelstart=99
set foldcolumn=0
" Sets how many lines of history VIM has to remember
set history=700
@@ -27,12 +20,6 @@ noremap ,, ,
" Use par for prettier line formatting
set formatprg="PARINIT='rTbgqR B=.,?_A_a Q=_s>|' par\ -w72"
" Use stylish haskell instead of par for haskell buffers
augroup haskell_file
autocmd!
autocmd FileType haskell let &formatprg="stylish-haskell"
augroup END
" Kill the damned Ex mode.
nnoremap Q <nop>
@@ -52,16 +39,6 @@ Bundle 'gmarik/vundle'
" Support bundles
Bundle 'scrooloose/syntastic'
" Git
Bundle 'tpope/vim-fugitive'
" Bars, panels, and files
"Bundle 'scrooloose/nerdtree'
Bundle 'bling/vim-airline'
" Haskell
Bundle 'raichoo/haskell-vim'
" Other programming languages
Bundle 'zepto-lang/zepto-vim'
Bundle 'hellerve/carp-vim'
@@ -73,18 +50,10 @@ Plugin 'JuliaEditorSupport/julia-vim'
" Extra
Plugin 'editorconfig/editorconfig-vim'
" Custom bundles
if filereadable(expand("~/.vim.local/bundles.vim"))
source ~/.vim.local/bundles.vim
endif
" }}}
" VIM user interface {{{
" Set 7 lines to the cursor - when moving vertically using j/k
set so=7
" Turn on the WiLd menu
set wildmenu
" Tab-complete files up to longest unambiguous prefix
@@ -144,12 +113,6 @@ endif
" Force redraw
map <silent> <leader>r :redraw!<CR>
" Turn mouse mode on
nnoremap <leader>ma :set mouse=a<cr>
" Turn mouse mode off
nnoremap <leader>mo :set mouse=<cr>
" Default to mouse mode on
set mouse=a
" }}}
@@ -202,9 +165,6 @@ augroup END
" Open file prompt with current path
nmap <leader>e :e <C-R>=expand("%:p:h") . '/'<CR>
" Show undo tree
nmap <silent> <leader>u :GundoToggle<CR>
" Fuzzy find files
nnoremap <silent> <Leader><space> :CtrlP<CR>
let g:ctrlp_max_files=0
@@ -233,10 +193,6 @@ set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
" Pretty unicode haskell symbols
let g:haskell_conceal_wide = 1
let g:haskell_conceal_enumerations = 1
" }}}
" Visual mode related {{{
@@ -277,7 +233,57 @@ set hidden
" Status line {{{
let g:mode_map={
\ '__' : '------',
\ 'c' : 'COMMAND',
\ 'i' : 'INSERT',
\ 'ic' : 'INSERT COMPL',
\ 'ix' : 'INSERT COMPL',
\ 'n' : 'NORMAL',
\ 'ni' : '(INSERT)',
\ 'no' : 'OP PENDING',
\ 'R' : 'REPLACE',
\ 'Rv' : 'V REPLACE',
\ 's' : 'SELECT',
\ 'S' : 'S-LINE',
\ '' : 'S-BLOCK',
\ 't' : 'TERMINAL',
\ 'v' : 'VISUAL',
\ 'V' : 'V-LINE',
\ '' : 'V-BLOCK',
\ }
let g:mode_color_map={
\ '__' : 'magenta',
\ 'c' : 'red',
\ 'i' : '208',
\ 'ic' : '208',
\ 'ix' : '208',
\ 'n' : 'white',
\ 'ni' : '208',
\ 'no' : 'red',
\ 'R' : '135',
\ 'Rv' : '135',
\ 's' : '135',
\ 'S' : '135',
\ '' : '135',
\ 't' : 'white',
\ 'v' : '135',
\ 'V' : '135',
\ '' : '135',
\ }
function! GetMode()
let col=get(g:mode_color_map, mode(), mode())
exec printf("hi StatusLine ctermbg=%s", col)
return get(g:mode_map, mode(), mode())
endfunction
set statusline=%{GetMode()}\ \ \ \ %.20f\ %m\ %r%=%c\ %l\/%L\ \(%2p%%\)\ %y
"set statusline=%y
" Always show the status line
set laststatus=2
" }}}
@@ -298,13 +304,6 @@ augroup END
" }}}
" Spell checking {{{
" Pressing ,ss will toggle and untoggle spell checking
map <leader>ss :setlocal spell!<cr>
" }}}
" Helper functions {{{
function! CmdLine(str)
@@ -336,93 +335,12 @@ endfunction
" }}}
" NERDTree {{{
" Close nerdtree after a file is selected
let NERDTreeQuitOnOpen = 1
function! IsNERDTreeOpen()
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction
function! ToggleFindNerd()
if IsNERDTreeOpen()
exec ':NERDTreeToggle'
else
exec ':NERDTreeFind'
endif
endfunction
" If nerd tree is closed, find current file, if open, close it
nmap <silent> <leader>f <ESC>:call ToggleFindNerd()<CR>
nmap <silent> <leader>F <ESC>:NERDTreeToggle<CR>
" }}}
" Alignment {{{
" Stop Align plugin from forcing its mappings on us
let g:loaded_AlignMapsPlugin=1
" Align on equal signs
map <Leader>a= :Align =<CR>
" Align on commas
map <Leader>a, :Align ,<CR>
" Align on pipes
map <Leader>a<bar> :Align <bar><CR>
" Prompt for align character
map <leader>ap :Align
" Enable some tabular presets for Haskell
let g:haskell_tabular = 1
" }}}
" Tags {{{
set tags=tags;/,codex.tags;/
" }}}
" Git {{{
let g:extradite_width = 60
" Hide messy Ggrep output and copen automatically
function! NonintrusiveGitGrep(term)
execute "copen"
" Map 't' to open selected item in new tab
execute "nnoremap <silent> <buffer> t <C-W><CR><C-W>T"
execute "silent! Ggrep " . a:term
execute "redraw!"
endfunction
function! CommittedFiles()
" Clear quickfix list
let qf_list = []
" Find files committed in HEAD
let git_output = system("git diff-tree --no-commit-id --name-only -r HEAD\n")
for committed_file in split(git_output, "\n")
let qf_item = {'filename': committed_file}
call add(qf_list, qf_item)
endfor
" Fill quickfix list with them
call setqflist(qf_list, '')
endfunction
" }}}
" Haskell Interrogation {{{
set completeopt+=longest
" Use buffer words as default tab completion
let g:SuperTabDefaultCompletionType = '<c-x><c-p>'
" Haskell Lint
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['haskell'] }
nmap <silent> <leader>hl :SyntasticCheck hlint<CR>
" }}}
" Conversion {{{
function! Pointfree()