diff --git a/.vim/ftplugin/go.vim b/.vim/ftplugin/go.vim new file mode 100644 index 0000000..bcdc40c --- /dev/null +++ b/.vim/ftplugin/go.vim @@ -0,0 +1,5 @@ +" don't show go fmt errors +let g:go_fmt_fail_silently = 1 + +" use literal tab characters in Go +set noexpandtab diff --git a/.vim/ftplugin/markdown.vim b/.vim/ftplugin/markdown.vim new file mode 100644 index 0000000..ade95c8 --- /dev/null +++ b/.vim/ftplugin/markdown.vim @@ -0,0 +1,2 @@ +" automatically insert newlines after character 78 +set textwidth=78 diff --git a/.vim/ftplugin/text.vim b/.vim/ftplugin/text.vim new file mode 100644 index 0000000..6afa9ea --- /dev/null +++ b/.vim/ftplugin/text.vim @@ -0,0 +1,2 @@ +" automatically insert line breaks after column 78 +set textwidth=78 diff --git a/.vim/ftplugin/vim.vim b/.vim/ftplugin/vim.vim new file mode 100644 index 0000000..81c0e33 --- /dev/null +++ b/.vim/ftplugin/vim.vim @@ -0,0 +1,9 @@ +" open .vim files with all folds closed +set foldlevelstart=0 + +" vim folds include explicit markers +set foldmethod=marker + +set shiftwidth=2 + +set tabstop=2 diff --git a/.vimrc b/.vimrc index 46c6822..cf988cb 100644 --- a/.vimrc +++ b/.vimrc @@ -1,6 +1,6 @@ set nocompatible -" Plugins {{{ +" Plugins -------------------------------------------------------------------{{{ " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() @@ -21,7 +21,7 @@ call vundle#begin() Plugin 'Align' Plugin 'tomtom/tlib_vim' " dependency of flashdevelop Plugin 'endel/flashdevelop.vim' - Plugin 'airblade/vim-gitgutter' + " Plugin 'airblade/vim-gitgutter' Plugin 'ctrlpvim/ctrlp.vim' Plugin 'itchyny/lightline.vim' Plugin 'heavenshell/vim-jsdoc' @@ -35,10 +35,9 @@ call vundle#end() " required " enable the filetype plugin filetype plugin indent on +" ---------------------------------------------------------------------------}}} -" }}} - -" Whitespace {{{ +" Whitespace ----------------------------------------------------------------{{{ " allow backspacing over line breaks set backspace=indent,eol,start @@ -64,9 +63,9 @@ set smarttab " set whitespace characters set listchars=tab:>-,trail:.,extends:# -" }}} +" ---------------------------------------------------------------------------}}} -" Search {{{ +" Search --------------------------------------------------------------------{{{ " perform searches incrementally set incsearch @@ -81,17 +80,16 @@ set hlsearch " press escape twice to clear highlight search nnoremap :nohlsearch -" }}} +" ---------------------------------------------------------------------------}}} -" Backup {{{ +" Backup --------------------------------------------------------------------{{{ set nobackup set nowritebackup set noswapfile -" }}} - -" Wild Menu {{{ +" ---------------------------------------------------------------------------}}} -" enabled the wild menu. +" Wild Menu -----------------------------------------------------------------{{{ +" enable the wild menu. set wildmenu " list matches @@ -102,9 +100,9 @@ set wildignore+=*.o,*.a,*.so " ignore compiled binaries set wildignore+=*.jpg,*.png,*.gif " ignore images set wildignore+=*.pdf " ignore pdf documents set wildignore+=*.pyc,*.pyo " ignore compiled Python files -" }}} +" ---------------------------------------------------------------------------}}} -" Mouse {{{ +" Mouse ---------------------------------------------------------------------{{{ " enable the mouse if has('mouse') set mouse=a @@ -115,9 +113,9 @@ set mousehide " open up directories with a single click instead of needing to double-click let g:NERDTreeMouseMode = 2 -" }}} +" ---------------------------------------------------------------------------}}} -" Set Colorscheme {{{ +" Set Colorscheme -----------------------------------------------------------{{{ if &t_Co > 2 || has("gui_running") " enable syntax highlighting syntax on @@ -132,9 +130,9 @@ if &t_Co > 2 || has("gui_running") endtry endif -" }}} +" ---------------------------------------------------------------------------}}} -" Autocmd Hooks {{{ +" Autocmd Hooks -------------------------------------------------------------{{{ if has("autocmd") " Put these in an autocmd group, so that we can delete them easily. augroup vimrcEx @@ -180,9 +178,9 @@ if has("autocmd") else endif -" }}} +" ---------------------------------------------------------------------------}}} -" Character Encoding {{{ +" Character Encoding --------------------------------------------------------{{{ " sets the character encoding used inside of vim itself. does not change how " files are written to disk. set encoding=utf-8 @@ -194,10 +192,9 @@ if has("multi_byte") let &termencoding = &encoding endif endif -" }}} - -" Status Line {{{ +" ---------------------------------------------------------------------------}}} +" Status Line ---------------------------------------------------------------{{{ " always show the status line set laststatus=2 @@ -246,9 +243,9 @@ noremap k gk noremap j gj noremap 0 g0 noremap $ g$ -" }}} +" ---------------------------------------------------------------------------}}} -" Normal Mode {{{ +" Normal Mode ---------------------------------------------------------------{{{ " toggle line numbering with n nnoremap n :set number! @@ -263,16 +260,16 @@ nnoremap sv :source $MYVIMRC " leader ci inverts comment states on a line by line basis noremap ci NERDComInvertComment -"}}} +" ---------------------------------------------------------------------------}}} -" Insert Mode {{{ +" Insert Mode ---------------------------------------------------------------{{{ " Ctrl-U deletes from the current position to the start of the line. inoremap u iabbrev @@ @jordanorelli -" }}} +" ---------------------------------------------------------------------------}}} -" Command Mode {{{ +" Command Mode --------------------------------------------------------------{{{ " new command mode command: w!! " allows you to sudo write the file you're currently editing without closing " (and thus losing) your changes. @@ -284,9 +281,9 @@ cabbrev vhelp vertical help " prevents editing a file named "~", which I literally never want. cabbrev ~ $HOME -"}}} +" ---------------------------------------------------------------------------}}} -" Operator-Pending Mode {{{ +" Operator-Pending Mode -----------------------------------------------------{{{ " new text object: "next paren". means the next open paren on the current " line. onoremap in( :normal! f(ci( @@ -294,26 +291,26 @@ onoremap in( :normal! f(ci( " new text object: "last paren". means the previous open paren on the current " line. (using p would shadow the paragraph object) onoremap il( :normal! F)vi( -" }}} +" ---------------------------------------------------------------------------}}} -" Supertab {{{ +" Supertab ------------------------------------------------------------------{{{ " use omnicomplete by default let g:SuperTabDefaultCompletionType = "" " close doc window after finishing an autocomplete let g:SuperTabClosePreviewOnPopupClose = 1 -" }}} +" ---------------------------------------------------------------------------}}} -" CtrlP {{{ +" CtrlP ---------------------------------------------------------------------{{{ let g:ctrlp_map = '' let g:ctrlp_cmd = 'CtrlP' let g:ctrlp_user_command = [ \ '.git', \ 'cd %s && git ls-files -co --exclude-standard' \ ] -" }}} +" ---------------------------------------------------------------------------}}} -" NERDTree {{{ +" NERDTree ------------------------------------------------------------------{{{ " fix windows arrows. This gets rid of the pretty arrows on other systems, " will have to restore that properly. The default switching behavior is broken " inside of msys2. @@ -322,16 +319,16 @@ let g:NERDTreeDirArrowCollapsible = '-' " enable dir tree arrows let g:NERDTreeDirArrows = 1 -" }}} +" ---------------------------------------------------------------------------}}} -" Commenting {{{ +" Commenting ----------------------------------------------------------------{{{ " left-align comment markers by default let g:NERDDefaultAlign='left' " insert a space after comment markers let g:NERDSpaceDelims=1 -" }}} +" ---------------------------------------------------------------------------}}} -" Misc {{{ +" Misc ----------------------------------------------------------------------{{{ " keep 50 lines of command line history set history=50 @@ -358,5 +355,4 @@ set visualbell " you know what, just disable the error bells entirely set noerrorbells - -" }}} +" ---------------------------------------------------------------------------}}} diff --git a/install.sh b/install.sh index 38558ea..d12e37e 100755 --- a/install.sh +++ b/install.sh @@ -10,9 +10,7 @@ include=( .bashrc .screenrc .tmux.conf - .vim/ftplugin/javascript.vim - .vim/ftplugin/ruby.vim - .vim/ftplugin/vim.vim + .vim/ftplugin/*.vim .vimrc )