summaryrefslogtreecommitdiffstats
path: root/vim/ftplugin
diff options
context:
space:
mode:
authoryushyin <yushyin@saga>2015-07-30 23:07:17 +0200
committeryushyin <yushyin@saga>2015-07-30 23:37:33 +0200
commit99f1c17274bcea036aca040642bb8377e95f6fcd (patch)
treebeb1f9e3969647fa099834987e8510af037ba312 /vim/ftplugin
downloaddotfiles-99f1c17274bcea036aca040642bb8377e95f6fcd.tar.gz
dotfiles-99f1c17274bcea036aca040642bb8377e95f6fcd.tar.xz
Add vim config
Diffstat (limited to 'vim/ftplugin')
-rw-r--r--vim/ftplugin/c.vim15
-rw-r--r--vim/ftplugin/haskell.vim33
-rw-r--r--vim/ftplugin/tex.vim4
3 files changed, 52 insertions, 0 deletions
diff --git a/vim/ftplugin/c.vim b/vim/ftplugin/c.vim
new file mode 100644
index 0000000..f3f7198
--- /dev/null
+++ b/vim/ftplugin/c.vim
@@ -0,0 +1,15 @@
+if has('cscope')
+ if filereadable("cscope.out")
+ cs add cscope.out
+ endif
+ nnoremap [cscope] <Nop>
+ nmap <C-\> [cscope]
+ nmap [cscope]s :cs find s <C-R>=expand("<cword>")<CR><CR>
+ nmap [cscope]g :cs find g <C-R>=expand("<cword>")<CR><CR>
+ nmap [cscope]c :cs find c <C-R>=expand("<cword>")<CR><CR>
+ nmap [cscope]t :cs find t <C-R>=expand("<cword>")<CR><CR>
+ nmap [cscope]e :cs find e <C-R>=expand("<cword>")<CR><CR>
+ nmap [cscope]f :cs find f <C-R>=expand("<cfile>")<CR><CR>
+ nmap [cscope]i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
+ nmap [cscope]d :cs find d <C-R>=expand("<cword>")<CR><CR>
+endif
diff --git a/vim/ftplugin/haskell.vim b/vim/ftplugin/haskell.vim
new file mode 100644
index 0000000..99f0cd7
--- /dev/null
+++ b/vim/ftplugin/haskell.vim
@@ -0,0 +1,33 @@
+setlocal omnifunc=necoghc#omnifunc ts=8 sts=4 sw=4 et sr
+
+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'
+ \ }
+\ }
diff --git a/vim/ftplugin/tex.vim b/vim/ftplugin/tex.vim
new file mode 100644
index 0000000..d3ea831
--- /dev/null
+++ b/vim/ftplugin/tex.vim
@@ -0,0 +1,4 @@
+nnoremap <expr> j v:count ? 'j' : 'gj'
+vnoremap <expr> j v:count ? 'j' : 'gj'
+nnoremap <expr> k v:count ? 'k' : 'gk'
+vnoremap <expr> k v:count ? 'k' : 'gk'