diff options
Diffstat (limited to 'stow/vim')
-rw-r--r-- | stow/vim/.vim/ftplugin/css/css.vim | 4 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/html/html.vim | 74 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/python/python.vim | 2 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/python/snips/for | 2 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/python/snips/if | 2 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/python/snips/template | 6 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/ruby/ruby.vim | 27 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/sh/sh.vim | 7 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/vimwiki/snips/template.txt | 4 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim | 4 |
10 files changed, 91 insertions, 41 deletions
diff --git a/stow/vim/.vim/ftplugin/css/css.vim b/stow/vim/.vim/ftplugin/css/css.vim index 695243c..f812209 100644 --- a/stow/vim/.vim/ftplugin/css/css.vim +++ b/stow/vim/.vim/ftplugin/css/css.vim @@ -14,7 +14,9 @@ setlocal tabstop=2 shiftwidth=2 expandtab setlocal nolist " Mappings + +let mapleader = " " + nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/css/css.vim<CR> nnoremap <buffer> <leader>e :Errors<CR> nnoremap <buffer> <leader>s vi{!sort<CR> - diff --git a/stow/vim/.vim/ftplugin/html/html.vim b/stow/vim/.vim/ftplugin/html/html.vim index 41890b4..d1ce4a3 100644 --- a/stow/vim/.vim/ftplugin/html/html.vim +++ b/stow/vim/.vim/ftplugin/html/html.vim @@ -14,7 +14,7 @@ setlocal textwidth=100 let mapleader = " " -nnoremap <buffer> <leader>o :!$BROWSER % &<CR><CR> +nnoremap <buffer> <leader>o :w<CR>:!$BROWSER % &<CR><CR> nnoremap <buffer> <leader>f :!firefox --new-window % &<CR><CR> nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/html/html.vim<CR> nnoremap <buffer> <leader>e :Errors<CR> @@ -24,55 +24,55 @@ nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/html/snips/template.txt<CR>G let mapleader = "," " Layout elements -inoremap <buffer> <leader>hheader <header><Enter><Enter></header><Enter><++><Esc>kki -inoremap <buffer> <leader>hnav <nav><Enter><Enter></nav><Enter><++><Esc>kki -inoremap <buffer> <leader>hsection <section><Enter><Enter></section><Enter><++><Esc>kki -inoremap <buffer> <leader>harticle <article><Enter><Enter></article><Enter><++><Esc>kki -inoremap <buffer> <leader>hfooter <footer><Enter><Enter></footer><Enter><++><Esc>kki -inoremap <buffer> <leader>haside <aside><Enter><Enter></aside><Enter><++><Esc>kki -inoremap <buffer> <leader>hdiv <div class=""><Enter><++><Enter></div><Enter><++><Esc>?""<Enter>a +inoremap <buffer> <leader>header <header><Enter><Enter></header><Enter><++><Esc>kki +inoremap <buffer> <leader>nav <nav><Enter><Enter></nav><Enter><++><Esc>kki +inoremap <buffer> <leader>section <section><Enter><Enter></section><Enter><++><Esc>kki +inoremap <buffer> <leader>article <article><Enter><Enter></article><Enter><++><Esc>kki +inoremap <buffer> <leader>footer <footer><Enter><Enter></footer><Enter><++><Esc>kki +inoremap <buffer> <leader>aside <aside><Enter><Enter></aside><Enter><++><Esc>kki +inoremap <buffer> <leader>div <div class=""><Enter><++><Enter></div><Enter><++><Esc>?""<Enter>a " Headers and paragraphs -inoremap <buffer> <leader>hh1 <h1></h1><Enter><++><Esc>?</h1><Enter>i -inoremap <buffer> <leader>hh2 <h2></h2><Enter><++><Esc>?</h2><Enter>i -inoremap <buffer> <leader>hh3 <h3></h3><Enter><++><Esc>?</h3><Enter>i -inoremap <buffer> <leader>hh4 <h4></h4><Enter><++><Esc>?</h4><Enter>i -inoremap <buffer> <leader>hh5 <h5></h5><Enter><++><Esc>?</h5><Enter>i -inoremap <buffer> <leader>hh6 <h6></h6><Enter><++><Esc>?</h6><Enter>i -inoremap <buffer> <leader>hp <p></p><Enter><++><Esc>?</p><Enter>i +inoremap <buffer> <leader>h1 <h1></h1><Enter><++><Esc>?</h1><Enter>i +inoremap <buffer> <leader>h2 <h2></h2><Enter><++><Esc>?</h2><Enter>i +inoremap <buffer> <leader>h3 <h3></h3><Enter><++><Esc>?</h3><Enter>i +inoremap <buffer> <leader>h4 <h4></h4><Enter><++><Esc>?</h4><Enter>i +inoremap <buffer> <leader>h5 <h5></h5><Enter><++><Esc>?</h5><Enter>i +inoremap <buffer> <leader>h6 <h6></h6><Enter><++><Esc>?</h6><Enter>i +inoremap <buffer> <leader>p <p></p><Enter><++><Esc>?</p><Enter>i " Text formatting -inoremap <buffer> <leader>hb <b></b><++><Esc>?</b><Enter>i -inoremap <buffer> <leader>hi <i></i><++><Esc>?</i><Enter>i -inoremap <buffer> <leader>hem <em></em><++><Esc>?</em><Enter>i -inoremap <buffer> <leader>hcode <code></code><++><Esc>?</code><Enter>i -inoremap <buffer> <leader>hsub <sub></sub><++><Esc>?</sub><Enter>i -inoremap <buffer> <leader>hsup <sup></sup><++><Esc>?</sup><Enter>i -inoremap <buffer> <leader>hcite <cite></cite><++><Esc>?</cite><Enter>i +inoremap <buffer> <leader>b <b></b><++><Esc>?</b><Enter>i +inoremap <buffer> <leader>i <i></i><++><Esc>?</i><Enter>i +inoremap <buffer> <leader>em <em></em><++><Esc>?</em><Enter>i +inoremap <buffer> <leader>code <code></code><++><Esc>?</code><Enter>i +inoremap <buffer> <leader>sub <sub></sub><++><Esc>?</sub><Enter>i +inoremap <buffer> <leader>sup <sup></sup><++><Esc>?</sup><Enter>i +inoremap <buffer> <leader>cite <cite></cite><++><Esc>?</cite><Enter>i " Tables -inoremap <buffer> <leader>htable <table border=""><Enter><caption><++></caption><Enter><thead><Enter><tr><Enter><++><Enter></tr><Enter></thead><Enter><tbody><Enter><++><Enter></tbody><Enter></table><Enter><++><Esc>?""<Enter>a -inoremap <buffer> <leader>htr <tr><Enter><Enter></tr><Enter><++><Esc>kki -inoremap <buffer> <leader>hth <th></th><Enter><++><Esc>?</<Enter>i -inoremap <buffer> <leader>htd <td></td><Enter><++><Esc>?</<Enter>i +inoremap <buffer> <leader>table <table border=""><Enter><caption><++></caption><Enter><thead><Enter><tr><Enter><++><Enter></tr><Enter></thead><Enter><tbody><Enter><++><Enter></tbody><Enter></table><Enter><++><Esc>?""<Enter>a +inoremap <buffer> <leader>tr <tr><Enter><Enter></tr><Enter><++><Esc>kki +inoremap <buffer> <leader>th <th></th><Enter><++><Esc>?</<Enter>i +inoremap <buffer> <leader>td <td></td><Enter><++><Esc>?</<Enter>i " Lists -inoremap <buffer> <leader>hul <ul><Enter><li></li><Enter><++><Enter></ul><Enter><++><Esc>?</l<Enter>i -inoremap <buffer> <leader>hol <ol><Enter><li></li><Enter><++><Enter></ol><Enter><++><Esc>?</l<Enter>i -inoremap <buffer> <leader>hli <li></li><Enter><++><Esc>?</<Enter>i +inoremap <buffer> <leader>ul <ul><Enter><li></li><Enter><++><Enter></ul><Enter><++><Esc>?</l<Enter>i +inoremap <buffer> <leader>ol <ol><Enter><li></li><Enter><++><Enter></ol><Enter><++><Esc>?</l<Enter>i +inoremap <buffer> <leader>li <li></li><Enter><++><Esc>?</<Enter>i " Forms -inoremap <buffer> <leader>hform <form><Enter><fieldset><Enter><Enter></fieldset><Enter></form><Enter><++><Esc>3ki -inoremap <buffer> <leader>hfs <fieldset><Enter><Enter></fieldset><Enter><++><Esc>kki -inoremap <buffer> <leader>hlegend <legend></legend><Enter><++><Esc>?</<Enter>i -inoremap <buffer> <leader>hlabel <label><input type="<++>"></label><Enter><++><Esc>?<i<Enter>i +inoremap <buffer> <leader>form <form><Enter><fieldset><Enter><Enter></fieldset><Enter></form><Enter><++><Esc>3ki +inoremap <buffer> <leader>fs <fieldset><Enter><Enter></fieldset><Enter><++><Esc>kki +inoremap <buffer> <leader>legend <legend></legend><Enter><++><Esc>?</<Enter>i +inoremap <buffer> <leader>label <label><input type="<++>"></label><Enter><++><Esc>?<i<Enter>i " Media -inoremap <buffer> <leader>ha <a href=""><++></a><Enter><++><Esc>?""<Enter>a -inoremap <buffer> <leader>himg <img src="" alt="<++>"><Enter><++><Esc>?""<Enter>a +inoremap <buffer> <leader>a <a href=""><++></a><Enter><++><Esc>?""<Enter>a +inoremap <buffer> <leader>img <img src="" alt="<++>"><Enter><++><Esc>?""<Enter>a " Misc " Comment a line -nnoremap <buffer> <leader>hc I<!-- <Esc>A --><Esc>0 +nnoremap <buffer> <leader>c I<!-- <Esc>A --><Esc>0 " Uncomment a line -nnoremap <buffer> <leader>hC 05x/--><Enter>3x0 +nnoremap <buffer> <leader>C 05x/--><Enter>3x0 diff --git a/stow/vim/.vim/ftplugin/python/python.vim b/stow/vim/.vim/ftplugin/python/python.vim index 358f902..b868b10 100644 --- a/stow/vim/.vim/ftplugin/python/python.vim +++ b/stow/vim/.vim/ftplugin/python/python.vim @@ -32,3 +32,5 @@ let mapleader = "," inoremap <buffer> <leader>temp <Esc>:-1r ~/.vim/ftplugin/python/snips/template<CR>Gdd?<+++><CR>cf> inoremap <buffer> <leader>class <Esc>:-1r ~/.vim/ftplugin/python/snips/class<CR>Gdd?<+++><CR>cf> +inoremap <buffer> <leader>if <Esc>:-1r ~/.vim/ftplugin/python/snips/if<CR>Gdd?<+++><CR>cf> +inoremap <buffer> <leader>for <Esc>:-1r ~/.vim/ftplugin/python/snips/for<CR>Gdd?<+++><CR>cf> diff --git a/stow/vim/.vim/ftplugin/python/snips/for b/stow/vim/.vim/ftplugin/python/snips/for new file mode 100644 index 0000000..b50f669 --- /dev/null +++ b/stow/vim/.vim/ftplugin/python/snips/for @@ -0,0 +1,2 @@ +for i in range(<+++>): + <++> diff --git a/stow/vim/.vim/ftplugin/python/snips/if b/stow/vim/.vim/ftplugin/python/snips/if new file mode 100644 index 0000000..af3cef1 --- /dev/null +++ b/stow/vim/.vim/ftplugin/python/snips/if @@ -0,0 +1,2 @@ +if (<+++>): + <++> diff --git a/stow/vim/.vim/ftplugin/python/snips/template b/stow/vim/.vim/ftplugin/python/snips/template index d10fa4a..52ea16f 100644 --- a/stow/vim/.vim/ftplugin/python/snips/template +++ b/stow/vim/.vim/ftplugin/python/snips/template @@ -2,4 +2,8 @@ """<+++>""" -<++> +def main(): + <++> + +if __name__ == '__main__': + main() diff --git a/stow/vim/.vim/ftplugin/ruby/ruby.vim b/stow/vim/.vim/ftplugin/ruby/ruby.vim new file mode 100644 index 0000000..41b806a --- /dev/null +++ b/stow/vim/.vim/ftplugin/ruby/ruby.vim @@ -0,0 +1,27 @@ +" ~/.vim/ftplugin/ruby/ruby.vim +" Ruby-specific vim configuration + +" Tabs are expanded to 4 spaces +setlocal tabstop=2 shiftwidth=2 expandtab +" Show existing tabs (they can be deleted with :retab) +setlocal list + +" Mappings +" +" For SonicPi + +if expand('%:p') =~ 'sonicPi' + + let mapleader = " " + + nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/ruby/ruby.vim<CR> + + nnoremap <buffer> <leader>p :w<CR>:!sonic-pi-tool eval-file %<CR><CR> + nnoremap <buffer> <leader><leader> :w<CR>:!sonic-pi-tool stop && sonic-pi-tool eval-file %<CR><CR> + nnoremap <buffer> <leader>s :!sonic-pi-tool stop<CR><CR> + + let mapleader = "," + + inoremap <buffer> <leader>loop loop do <CR><+++><CR>end<CR><++><Esc>?<+++><CR>cf> + +endif diff --git a/stow/vim/.vim/ftplugin/sh/sh.vim b/stow/vim/.vim/ftplugin/sh/sh.vim index 3eb4da5..ef41fa1 100644 --- a/stow/vim/.vim/ftplugin/sh/sh.vim +++ b/stow/vim/.vim/ftplugin/sh/sh.vim @@ -6,11 +6,18 @@ call matchadd('ColorColumn', '\%111v', 100) setlocal textwidth=110 +" Mappings + +let mapleader = " " + nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/sh/sh.vim<CR> nnoremap <buffer> <leader>+x :!chmod 744 %<CR><CR> nnoremap <buffer> <leader>x :w<CR>:!./%<Space> +nnoremap <buffer> <leader>X :w<CR>:!./%<CR><CR> nnoremap <buffer> <leader>e :Errors<CR> +let mapleader = "," + inoremap <buffer> <leader>sh #!/bin/sh inoremap <buffer> <leader>if if <+++>; then<CR><++><CR>fi<++><Esc>?<+++><CR>cf> "inoremap <buffer> <leader>if <Esc>:read ~/.vim/ftplugin/sh/snippets/if.txt<CR>kdd/<+++><CR>cf> diff --git a/stow/vim/.vim/ftplugin/vimwiki/snips/template.txt b/stow/vim/.vim/ftplugin/vimwiki/snips/template.txt index f6b16a8..2577d85 100644 --- a/stow/vim/.vim/ftplugin/vimwiki/snips/template.txt +++ b/stow/vim/.vim/ftplugin/vimwiki/snips/template.txt @@ -1,6 +1,10 @@ --- header-includes: - \usepackage[margin=1.5in]{geometry} + - \pagenumbering{gobble} + +lang: es-ES +indent: true title: "Title" author: diff --git a/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim b/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim index c361600..b6c2e8f 100644 --- a/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim +++ b/stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim @@ -27,10 +27,10 @@ let mapleader = " " nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/vimwiki/vimwiki.vim<CR> nnoremap <buffer> <leader>e :Errors<CR> -nnoremap <buffer> <leader>tt :r ~/.vim/ftplugin/vimwiki/snips/template.txt<CR> +nnoremap <buffer> <leader>temp :r ~/.vim/ftplugin/vimwiki/snips/template.txt<CR> nnoremap <buffer> <leader>tp :r ~/.vim/ftplugin/vimwiki/snips/plantUml.txt<CR>/<+++><CR>cf> -nnoremap <buffer> <leader>c :w<CR>:!toPDF.sh "%"<CR> +nnoremap <buffer> <leader>c :w<CR>:!toPDF.sh "%"<CR><CR> nnoremap <buffer> <leader>o :w<CR>:!toPDF.sh -o "%"<CR><CR> let mapleader = "," |