commit b7d4ab12fc0b1db0a705924db2d688e57fe1bd42
parent 0bcf4f2bd7bad8377aeaf0bcdfeb5a3319ad6c3a
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Sun, 29 Sep 2019 14:08:49 -0400
vim: various changes
Former-commit-id: 0c3cad58b476f293dfc855fbe7f539da4289ca53
Diffstat:
5 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/vim/plugin/saveas.vim b/vim/plugin/saveas.vim
@@ -0,0 +1,5 @@
+function! s:saveas()
+ let cursor_pos = repeat("\<Left>", len(expand("%:e"))+1)
+ return "saveas ".expand("%:p").cursor_pos
+endfunction
+cnoreabbrev <expr> san <SID>saveas()
diff --git a/vim/plugin/vimcolor.vim b/vim/plugin/vimcolor.vim
@@ -0,0 +1,13 @@
+function! s:edit_colors()
+ execute "split ~/.vim/colors/".g:colors_name.".vimcolor"
+endfunction
+
+function! s:synstack()
+ if !exists("*synstack")
+ return
+ endif
+ echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"
+endfunction
+
+nnoremap <Plug>VimcolorEdit :call <SID>edit_colors()<CR>
+nnoremap <Plug>VimcolorSynstack :call <SID>synstack()<CR>
diff --git a/vim/ultisnips/haskell.snippets b/vim/ultisnips/haskell.snippets
@@ -0,0 +1,11 @@
+snippet describe "Hspec Describe" b
+describe "${1:function name}" $ do
+ it "${2:what it does}" $ do
+ ${3:{call}} \`shouldBe\` ${4:{result}}
+ $0
+endsnippet
+snippet it "Hspec It" b
+it "${1:what it does}" $ do
+ ${2:{call}} \`shouldBe\` ${3:{result}}
+$0
+endsnippet
diff --git a/vim/ultisnips/vim.snippets b/vim/ultisnips/vim.snippets
@@ -0,0 +1,7 @@
+snippet undo_ftplugin "Undo an ftplugin config" b
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin .= '| ${1:{changes to make}}'
+else
+ let b:undo_ftplugin = '| $1'
+endif
+endsnippet
diff --git a/vim/vimrc b/vim/vimrc
@@ -187,6 +187,16 @@ let g:tagbar_type_conf = {
\ ],
\ 'sort': 0
\ }
+let g:tagbar_type_zsh = {
+ \ 'ctagstype' : 'zsh',
+ \ 'kinds' : [
+ \ 's:Source scripts',
+ \ 'e:Environment variables',
+ \ 'f:Functions',
+ \ 'm:Mappings'
+ \ ],
+ \ 'sort': 0
+ \ }
" }}}
" Doge {{{
let g:doge_mapping = '<leader>gd'
@@ -248,6 +258,12 @@ nmap <leader>sq <Plug>CloseSession
" Sparkup {{{
let g:sparkupExecuteMapping = '<C-x><C-e>'
" }}}
+" Haskell {{{
+let hs_highlight_delimiters = 1
+let hs_highlight_boolean = 1
+let hs_highlight_types = 1
+let hs_highlight_more_types = 1
+" }}}
" }}}
" }}}
" General {{{
@@ -522,7 +538,7 @@ if has('terminal')
cnoreabbrev tt tab terminal
cnoreabbrev wt terminal
cnoreabbrev tm terminal man
- cnoreabbrev tr terminal ranger
+ cnoreabbrev tr terminal lf
endif
" }}}
" Symbols {{{
@@ -622,7 +638,7 @@ vnoremap ; :
tnoremap <C-w>; <C-w>:
" To keep the old functionality of ;
-nnoremap <leader>; ;
+nnoremap : ;
" Disable q: cuz I hate it
" (also C-F does the same)
@@ -702,6 +718,7 @@ nnoremap <C-E><C-G> :vsplit $MYVIMRC<CR>gg/General {{<CR>:noh<CR>za
nnoremap <C-E><C-V> :vsplit $MYVIMRC<CR>gg
nnoremap <C-E><C-M> :vsplit $MYVIMRC<CR>gg/Mappings {{<CR>:noh<CR>za
nnoremap <C-E><C-P> :vsplit $MYVIMRC<CR>gg/Plugins {{<CR>:noh<CR>za
+nmap <C-E><C-L> <Plug>VimcolorEdit
" Yank to clipboard
nnoremap <leader>d "+d
@@ -742,7 +759,7 @@ vmap <leader><CR> <Plug>VisualRunCommands
nnoremap H :bprevious<CR>
nnoremap L :bnext<CR>
-nnoremap <C-P> :call synstack#SynStack()<CR>
+nmap <C-P> <Plug>VimcolorSynstack
inoremap <C-x>s <c-g>u<Esc>[s1z=`]a<c-g>u