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 <++>
<++>?i
-inoremap hli <++>?i
+inoremap ul <++>?i
+inoremap ol <++>
<++>?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