Browse Source

moved filetype specific commands to the ftplugin dir

bananicorn 5 years ago
parent
commit
d1e16a1533

+ 2 - 0
.vim/ftplugin/css.vim

@@ -0,0 +1,2 @@
+"count - as part of a word when doing operations
+set iskeyword+=\-

+ 2 - 0
.vim/ftplugin/php.vim

@@ -0,0 +1,2 @@
+"count $ as part of a word when doing operations
+set iskeyword+=\$

+ 7 - 0
.vim/ftplugin/plan.vim

@@ -0,0 +1,7 @@
+"nice highlighting for my checklists
+highlight Checked ctermfg=White ctermbg=DarkGreen
+highlight Unchecked ctermfg=White ctermbg=DarkRed
+highlight Optional ctermfg=Black ctermbg=Yellow
+syn match Unchecked /\[ \]/
+syn match Checked /\[x\]/
+syn match Optional /\[?\]/

+ 1 - 0
.vim/ftplugin/python.vim

@@ -0,0 +1 @@
+set noexpandtab

+ 3 - 0
.vim/ftplugin/scss.vim

@@ -0,0 +1,3 @@
+"count $ and - as part of a word when doing operations
+set iskeyword+=\$
+set iskeyword+=\-

+ 1 - 0
.vim/ftplugin/tsv.vim

@@ -0,0 +1 @@
+setlocal tabstop=20

+ 1 - 0
.vim/ftplugin/twig.vim

@@ -0,0 +1 @@
+setlocal ft=html

+ 2 - 0
.vim/ftplugin/txt.vim

@@ -0,0 +1,2 @@
+setlocal spell
+setlocal tw=80

+ 6 - 39
.vimrc

@@ -31,6 +31,9 @@ set wildmenu
 "then tab through the options
 set wildmode=longest:list,full
 
+"put new windows to the right/below
+set splitright
+set splitbelow
 
 "NO, I don't want ANSI.
 set fileencodings=utf-8
@@ -45,8 +48,6 @@ filetype indent plugin on
 "I should set this up to work with <C-N>
 filetype plugin on
 set omnifunc=syntaxcomplete#Complete
-"also autocomplete words which are hyphen-separated
-set iskeyword+=\-
 
 "colorscheme zellner
 colorscheme gentooish "available in the void-package vim-colorschemes
@@ -121,40 +122,6 @@ nnoremap , ;
 nnoremap <silent> <esc><esc> :noh<CR>
 " nnoremap <silent> <esc> :noh<CR>
 
-
-"AUTOCOMMANDS
-"for povray files
-augroup pov
-autocmd!
-	au BufWritePost *.pov !povray .
-augroup END
-
-"for the regular text
-augroup txt
-autocmd!
-	au BufReadPost *.txt setlocal spell
-	au BufReadPost *.txt setlocal tw=80
-	au BufReadPost *.txt highlight Checked ctermfg=White ctermbg=DarkGreen
-	au BufReadPost *.txt highlight Unchecked ctermfg=White ctermbg=DarkRed
-	au BufReadPost *.txt syn match Unchecked /\[ \]/
-	au BufReadPost *.txt syn match Checked /\[x\]/
-augroup END
-
-"for the regular text
-augroup md
-autocmd!
-	au BufReadPost *.md setlocal spell
-	au BufReadPost *.md setlocal tw=80
-augroup END
-
-"for tsv files - which I like to be nicely aligned
-augroup tsv
-autocmd!
-	au BufReadPost *.tsv setlocal tabstop=20
-augroup END
-
-"for the twig templating language
-augroup twig
-autocmd!
-	au BufReadPost *.twig set ft=html
-augroup END
+"add custom/unknown filetypes
+autocmd BufNewFile,BufRead *.plan set filetype=plan
+autocmd BufNewFile,BufRead *.tsv set filetype=tsv

+ 2 - 0
setup-vim.sh

@@ -6,6 +6,8 @@ mkdir ~/.vim/undofiles
 mkdir ~/.vim/swapfiles
 mkdir ~/.vim/sessions
 
+ln -s ~/dotfiles/.vim/ftplugin ~/.vim/
+
 #install all the plugins
 cd ~/.vim/plugin
 git clone "https://github.com/scrooloose/nerdcommenter"