From 5d40569e5c1ca453df1bf7b0547f3f69e3e684d7 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Wed, 21 Feb 2018 01:01:29 -0500 Subject: Add a makefile to rework init.vim. Commit update init.vm TODO: remove in the future and run make in setup --- vim/Makefile | 54 ++++++++++++++++++++++++++++++ vim/base.vim | 48 +++++++++++++++++++++++++++ vim/filetypes.vim | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ vim/listchars.vim | 12 +++++++ vim/mouse.vim | 8 +++++ vim/plugins.vim | 34 +++++++++++++++++++ vim/syntax.vim | 7 ++++ vim/warning.vim | 9 +++++ 8 files changed, 270 insertions(+) create mode 100644 vim/Makefile create mode 100644 vim/base.vim create mode 100644 vim/filetypes.vim create mode 100644 vim/listchars.vim create mode 100644 vim/mouse.vim create mode 100644 vim/plugins.vim create mode 100644 vim/syntax.vim create mode 100644 vim/warning.vim (limited to 'vim') diff --git a/vim/Makefile b/vim/Makefile new file mode 100644 index 0000000..b0ad1fd --- /dev/null +++ b/vim/Makefile @@ -0,0 +1,54 @@ + +all: default install clean + +install: + cp stage ../init.vim + +clean: + rm stage + +main: + cat \ + base.vim \ + plugins.vim \ + filetypes.vim \ + listchars.vim \ + mouse.vim \ + syntax.vim \ + >> stage + +default:main + echo "colorscheme distinguished" \ + >> stage + +solarized: + echo "colorscheme solarized" >> stage + +solarized_dark: solarized + echo "set backgroud=dark" >> stage + +solarized_256: solarized + echo "let g:solarized_termcolors=256" >> stage + +solarized_dark_256: solarized solarized_dark solarized_256 + +base: + # Disable Plugins for base + sed -i -e'/pathogen#infect/d' stage + cat \ + warning.vim \ + base.vim \ + > stage + + +help: + @echo "Current build options are:" + @echo " default: builds full configuratoin ( default )" + @echo " main: builds full configuratoin without colors" + @echo " solarized: adds solarized light ( requires terminal theme )" + @echo " solarized_dark: adds solarized dark ( requires terminal theme )" + @echo " solarized_256: adds solarized ( 256color )" + @echo " solarized_dark_256: adds solarized dark ( 256color )" + @echo " base: builds a basic configuration" + @echo " clean: cleans the stage file" + @echo " install: installs the staged config" diff --git a/vim/base.vim b/vim/base.vim new file mode 100644 index 0000000..73bd8c1 --- /dev/null +++ b/vim/base.vim @@ -0,0 +1,48 @@ +set encoding=utf-8 " The encoding displayed. +set fileencoding=utf-8 " The encoding written to file. + +" Apparently there are security issues with this? +set nomodeline + +execute pathogen#infect('bundle/{}', 'themes/{}') + +" Allow me to hide buffers w/o saving +set hidden + +" Persistent undo +set undofile +set undodir=~/.vimundo +set undolevels=1000 +set undoreload=10000 + +" lots of history, it's always nice to find old nasty command that happen +" to be really useful +set history=10000 +" +" Keep the newbs from using arrow keys +inoremap +inoremap +inoremap +inoremap + +" Always show status line +set laststatus=2 + +" Case insensitive searching by default +set ic +" Highlight my searches by default +set hls + +" No more swap files +set updatecount=0 + +" Vi in-compatibility +set nocompatible + + +" Bring down the tab spacing +set tabstop=4 +set shiftwidth=4 +set noexpandtab + + diff --git a/vim/filetypes.vim b/vim/filetypes.vim new file mode 100644 index 0000000..b14b47e --- /dev/null +++ b/vim/filetypes.vim @@ -0,0 +1,98 @@ +autocmd Filetype python call SetPythonOptions() +autocmd Filetype htmldjango call SethtmldjangoOptions() +autocmd Filetype json call SetJsonOptions() +autocmd Filetype javascript call SetjavascriptOptions() +autocmd Filetype php call SetPHPOptions() +autocmd Filetype html call SetHTMLOptions() +autocmd Filetype sh call SetShellOptions() +autocmd Filetype go call SetGoOptions() +autocmd Filetype yaml call SetYamlOptions() +autocmd Filetype markdown call SetMarkdownOptions() + +function SetMarkdownOptions() + set spell + set tabstop=4 + set shiftwidth=4 + set expandtab + AcpDisable +endfunction +function SetPythonOptions() + set tabstop=4 + set shiftwidth=4 + set expandtab + filetype indent on + set smartindent +endfunction +function SetjavascriptOptions() + set tabstop=2 + set shiftwidth=2 + set expandtab + filetype indent on + set smartindent +endfunction +function SetJsonOptions() + set tabstop=3 + set shiftwidth=3 + set expandtab + filetype indent on + set smartindent +endfunction +function SethtmldjangoOptions() + set tabstop=2 + set shiftwidth=2 + set expandtab + filetype indent on + set smartindent +endfunction +function SetPHPOptions() + set colorcolumn=120 + set tabstop=4 + set shiftwidth=4 + set expandtab + filetype indent on + set smartindent +endfunction +function SetHTMLOptions() + set colorcolumn=120 + set tabstop=2 + set shiftwidth=2 + set expandtab + filetype indent on + set smartindent +endfunction +function SetShellOptions() + set tabstop=4 + set shiftwidth=4 + set noexpandtab + filetype indent on + set smartindent +endfunction +function SetGoOptions() + " colorscheme acme + " syntax off + " colorscheme 256_noir + AcpDisable + set nolist + set noic + set nolist +endfunction +function SetYamlOptions() + " set listchars=tab:▸\ ,eol:¬,trail:•,space:· + set listchars=tab:▸\ ,eol:¬,trail:• + set expandtab + set noic +endfunction + +" This is specifically for Salt's state files 'sls' +autocmd BufNewFile,BufRead *.sls set filetype=yaml + + +function! PhpSyntaxOverride() + hi! def link phpDocTags phpDefine + hi! def link phpDocParam phpType +endfunction + +augroup phpSyntaxOverride + autocmd! + autocmd FileType php call PhpSyntaxOverride() +augroup END diff --git a/vim/listchars.vim b/vim/listchars.vim new file mode 100644 index 0000000..74af5df --- /dev/null +++ b/vim/listchars.vim @@ -0,0 +1,12 @@ +" Backslash l +nmap l :set list! +" If you want listchars +set list +" set listchars=tab:\|\ +set listchars=tab:▸\ ,eol:¬,trail:• +" set listchars=tab:▸\ ,eol:¬ +" set listchars=tab:\|\ ,eol:↴ +" set listchars=tab:\|\ ,eol:$ +" set listchars=tab:\⇒\ ,eol:↴ +" Tabs show up as MARCON, aka 0xC2 0xAF +" Misc symbols for tabs: ¯ ⇒ ⇥ ⇨ ⇏ ⇸ → diff --git a/vim/mouse.vim b/vim/mouse.vim new file mode 100644 index 0000000..3679475 --- /dev/null +++ b/vim/mouse.vim @@ -0,0 +1,8 @@ + +" Be smart about the mouse +set mouse+=a +if &term =~ '^screen' + " tmux knows the extended mouse mode + set ttymouse=xterm2 +endif + diff --git a/vim/plugins.vim b/vim/plugins.vim new file mode 100644 index 0000000..83c220a --- /dev/null +++ b/vim/plugins.vim @@ -0,0 +1,34 @@ +" Maily for the ability to match HTML tags with '%' +runtime macros/matchit.vim + +" Love hate relationship with this thing. I guess it's back +map :NERDTreeToggle + + +" To enable/disable the autocomplete dropdown +nmap [ :AcpDisable +nmap ] :AcpEnable + +" Gundo +nnoremap :GundoToggle +" +" Enable the list of buffers +let g:airline#extensions#tabline#enabled = 1 + +" Show just the filename +let g:airline#extensions#tabline#fnamemod = ':t' + +" This lets you just hit enter instead +" of pressing control-n Some people like it +" personally I'm not that much of a fan +" set completeopt=longest,menuone + +" Omni completion +filetype plugin on +set omnifunc=syntaxcomplete#Complete + +nmap :TagbarToggle + +let g:ctrlp_follow_symlinks = 1 +let g:ctrlp_working_path_mode = 0 + diff --git a/vim/syntax.vim b/vim/syntax.vim new file mode 100644 index 0000000..ac43b2a --- /dev/null +++ b/vim/syntax.vim @@ -0,0 +1,7 @@ + +" Line numbers +set nu + +" Derp +syntax on +" syntax off diff --git a/vim/warning.vim b/vim/warning.vim new file mode 100644 index 0000000..429a12e --- /dev/null +++ b/vim/warning.vim @@ -0,0 +1,9 @@ +" __ ___ ____ _ _ ___ _ _ ____ +" \ \ / / \ | _ \| \ | |_ _| \ | |/ ___| +" \ \ /\ / / _ \ | |_) | \| || || \| | | _ +" \ V V / ___ \| _ <| |\ || || |\ | |_| | +" \_/\_/_/ \_\_| \_\_| \_|___|_| \_|\____| +" +" File automatically generated see $HOME/.vim/vim + + -- cgit v1.2.3