From 9e06311db167a4ca76bcc34c81d02abd19bfe8a1 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Fri, 10 Dec 2021 19:54:38 +0100 Subject: A bunch of changes to different filetypes for vim. --- stow/vim/.vim/ftplugin/css/css.vim | 4 +- stow/vim/.vim/ftplugin/html/html.vim | 74 +++++++++++------------ stow/vim/.vim/ftplugin/python/python.vim | 2 + stow/vim/.vim/ftplugin/python/snips/for | 2 + stow/vim/.vim/ftplugin/python/snips/if | 2 + stow/vim/.vim/ftplugin/python/snips/template | 6 +- stow/vim/.vim/ftplugin/ruby/ruby.vim | 27 +++++++++ stow/vim/.vim/ftplugin/sh/sh.vim | 7 +++ stow/vim/.vim/ftplugin/vimwiki/snips/template.txt | 4 ++ stow/vim/.vim/ftplugin/vimwiki/vimwiki.vim | 4 +- 10 files changed, 91 insertions(+), 41 deletions(-) create mode 100644 stow/vim/.vim/ftplugin/python/snips/for create mode 100644 stow/vim/.vim/ftplugin/python/snips/if create mode 100644 stow/vim/.vim/ftplugin/ruby/ruby.vim (limited to 'stow/vim/.vim') 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 C :sp ~/.vim/ftplugin/css/css.vim nnoremap e :Errors nnoremap s vi{!sort - 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 o :!$BROWSER % & +nnoremap o :w:!$BROWSER % & nnoremap f :!firefox --new-window % & nnoremap C :sp ~/.vim/ftplugin/html/html.vim nnoremap e :Errors @@ -24,55 +24,55 @@ nnoremap temp :-1r ~/.vim/ftplugin/html/snips/template.txtG let mapleader = "," " Layout elements -inoremap hheader
<++>kki -inoremap hnav <++>kki -inoremap hsection
<++>kki -inoremap harticle
<++>kki -inoremap hfooter
<++>kki -inoremap haside <++>kki -inoremap hdiv
<++>
<++>?""a +inoremap header
<++>kki +inoremap nav <++>kki +inoremap section
<++>kki +inoremap article
<++>kki +inoremap footer
<++>kki +inoremap aside <++>kki +inoremap div
<++>
<++>?""a " Headers and paragraphs -inoremap hh1

<++>?i -inoremap hh2

<++>?i -inoremap hh3

<++>?i -inoremap hh4

<++>?i -inoremap hh5
<++>?i -inoremap hh6
<++>?i -inoremap hp

<++>?

i +inoremap h1

<++>?i +inoremap h2

<++>?i +inoremap h3

<++>?i +inoremap h4

<++>?i +inoremap h5
<++>?i +inoremap h6
<++>?i +inoremap p

<++>?

i " Text formatting -inoremap hb <++>?i -inoremap hi <++>?i -inoremap hem <++>?i -inoremap hcode <++>?i -inoremap hsub <++>?i -inoremap hsup <++>?i -inoremap hcite <++>?i +inoremap b <++>?i +inoremap i <++>?i +inoremap em <++>?i +inoremap code <++>?i +inoremap sub <++>?i +inoremap sup <++>?i +inoremap cite <++>?i " Tables -inoremap htable <++><++>
<++>
<++>?""a -inoremap htr <++>kki -inoremap hth <++>?i -inoremap htd <++>?i +inoremap table <++><++>
<++>
<++>?""a +inoremap tr <++>kki +inoremap th <++>?i +inoremap td <++>?i " Lists -inoremap hul
  • <++>
<++>?i -inoremap hol
  1. <++>
<++>?i -inoremap hli
  • <++>?i +inoremap ul
    • <++>
    <++>?i +inoremap ol
    1. <++>
    <++>?i +inoremap li
  • <++>?i " Forms -inoremap hform
    <++>3ki -inoremap hfs
    <++>kki -inoremap hlegend <++>?i -inoremap hlabel <++>?i +inoremap form
    <++>3ki +inoremap fs
    <++>kki +inoremap legend <++>?i +inoremap label <++>?i " Media -inoremap ha <++><++>?""a -inoremap himg <++><++>?""a +inoremap a <++><++>?""a +inoremap img <++><++>?""a " Misc " Comment a line -nnoremap hc I0 +nnoremap c I0 " Uncomment a line -nnoremap hC 05x/-->3x0 +nnoremap C 05x/-->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 temp :-1r ~/.vim/ftplugin/python/snips/templateGdd?<+++>cf> inoremap class :-1r ~/.vim/ftplugin/python/snips/classGdd?<+++>cf> +inoremap if :-1r ~/.vim/ftplugin/python/snips/ifGdd?<+++>cf> +inoremap for :-1r ~/.vim/ftplugin/python/snips/forGdd?<+++>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 C :sp ~/.vim/ftplugin/ruby/ruby.vim + + nnoremap p :w:!sonic-pi-tool eval-file % + nnoremap :w:!sonic-pi-tool stop && sonic-pi-tool eval-file % + nnoremap s :!sonic-pi-tool stop + + let mapleader = "," + + inoremap loop loop do <+++>end<++>?<+++>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 C :sp ~/.vim/ftplugin/sh/sh.vim nnoremap +x :!chmod 744 % nnoremap x :w:!./% +nnoremap X :w:!./% nnoremap e :Errors +let mapleader = "," + inoremap sh #!/bin/sh inoremap if if <+++>; then<++>fi<++>?<+++>cf> "inoremap if :read ~/.vim/ftplugin/sh/snippets/if.txtkdd/<+++>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 C :sp ~/.vim/ftplugin/vimwiki/vimwiki.vim nnoremap e :Errors -nnoremap tt :r ~/.vim/ftplugin/vimwiki/snips/template.txt +nnoremap temp :r ~/.vim/ftplugin/vimwiki/snips/template.txt nnoremap tp :r ~/.vim/ftplugin/vimwiki/snips/plantUml.txt/<+++>cf> -nnoremap c :w:!toPDF.sh "%" +nnoremap c :w:!toPDF.sh "%" nnoremap o :w:!toPDF.sh -o "%" let mapleader = "," -- cgit v1.2.1