From 9b5e7351cfe38471546b37bf15df56397ca085f1 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 24 Aug 2016 10:39:39 -0400 Subject: [PATCH 01/21] Adds usbify as submodule --- .gitmodules | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..889799550 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "usbify"] + path = usbify + url = https://github.com/wpcarro/usbify.git From 7e76ce2e34b0414b9187c3cebf29a967e32e9ae3 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 26 Aug 2016 17:01:25 -0400 Subject: [PATCH 02/21] Extends tmux support and vim configs --- configs/.tmux.conf | 1 - usbify/.gitignore | 2 + usbify/update.sh | 55 +++++++++++ usbify/vim/.vimrc | 161 +++++++++++++++++++++++++++++++++ usbify/vim/vim_point_to_usb.sh | 52 +++++++++++ 5 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 usbify/.gitignore create mode 100755 usbify/update.sh create mode 100644 usbify/vim/.vimrc create mode 100755 usbify/vim/vim_point_to_usb.sh diff --git a/configs/.tmux.conf b/configs/.tmux.conf index 04b210c12..45ef0596e 100644 --- a/configs/.tmux.conf +++ b/configs/.tmux.conf @@ -1,5 +1,4 @@ set -g default-terminal "screen-256color" -set -g mouse on bind-key -r -T prefix k select-pane -U bind-key -r -T prefix j select-pane -D diff --git a/usbify/.gitignore b/usbify/.gitignore new file mode 100644 index 000000000..f31b3e29c --- /dev/null +++ b/usbify/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +*.swp diff --git a/usbify/update.sh b/usbify/update.sh new file mode 100755 index 000000000..57a5965e9 --- /dev/null +++ b/usbify/update.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# This script is used to ensure the USB has the latest code from the repository. + +# Update the following values to reflect the locations of each directory on your +# particular machine. +path_to_local_repo="$HOME/pc_settings" # path to git repo +path_to_ext_device="/Volumes/usb_vim" # path to USB device + + +if [ ! -d "$path_to_ext_device" ]; then + echo "No external device found at ${path_to_ext_device}." && \ + echo "Make sure the values input within update.sh are correct." && \ + echo "path_to_ext_device: $path_to_ext_device" && \ + echo "Exiting." && return 1 +fi + +if [ ! -d "$path_to_local_repo" ]; then + echo "No repository found at ${path_to_local_repo}." && \ + echo "Make sure the values input within update.sh are correct." && \ + echo "path_to_local_repo: $path_to_local_repo" && \ + echo "Exiting." && return 1 +fi + + +# Update the local copy of the repo. +echo -n "Updating pc_settings..." && \ + pushd "$path_to_local_repo" >/dev/null && \ + git pull origin master >/dev/null + + if [ ! "$?" -eq 0 ]; then + echo "Error: git pull error. Exiting." && \ + return 1 + else + echo "Done." + fi + + +# Copy vim directory to USB device. +echo -n "Copying files to external device..." && \ + pushd "$path_to_ext_device" >/dev/null && \ + rm -rf "${path_to_ext_device}/vim" &>/dev/null && \ + cp -r "${path_to_local_repo}/usbify/vim" "${path_to_ext_device}/vim" \ + &>/dev/null && \ + + if [ ! "$?" -eq 0 ]; then + echo "Error: rm or cp error. Exiting." && \ + return 1 + else + echo "Done." + fi + + +# restore the dirs to its state before running this script +popd >/dev/null && popd >/dev/null && echo "Complete." && return 0 diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc new file mode 100644 index 000000000..604e39726 --- /dev/null +++ b/usbify/vim/.vimrc @@ -0,0 +1,161 @@ +" -- BEGIN: Vundle config -- +set nocompatible " be iMproved, required +filetype off " required + +" set the runtime path to include Vundle and initialize +set rtp+=~/.vim/bundle/Vundle.vim +call vundle#begin() +" alternatively, pass a path where Vundle should install plugins +"call vundle#begin('~/some/path/here') + +" let Vundle manage Vundle, required +Plugin 'VundleVim/Vundle.vim' + +" The following are examples of different formats supported. +" Keep Plugin commands between vundle#begin/end. +" plugin on GitHub repo +Plugin 'tpope/vim-fugitive' + +" All of your Plugins must be added before the following line +Plugin 'Raimondi/delimitMate' +Plugin 'Valloric/YouCompleteMe' +Plugin 'kien/ctrlp.vim' +Plugin 'mileszs/ack.vim' +Plugin 'pangloss/vim-javascript' +Plugin 'scrooloose/nerdtree' +Plugin 'scrooloose/syntastic' +Plugin 'sickill/vim-monokai' +Plugin 'sjl/clam.vim' +Plugin 'airblade/vim-gitgutter' + + +call vundle#end() " required +filetype plugin indent on " required +" To ignore plugin indent changes, instead use: +"filetype plugin on +" +" Brief help +" :PluginList - lists configured plugins +" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate +" :PluginSearch foo - searches for foo; append `!` to refresh local cache +" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal +" +" see :h vundle for more details or wiki for FAQ +" Put your non-Plugin stuff after this line +" -- END: Vundle config -- + + +" backspace settings +set backspace=2 +set backspace=indent,eol,start + + +" Javascript specific variables +let g:javascript_plugin_jsdoc = 1 +" set foldmethod=syntax + +" GlobalListchars +set list +set listchars=eol:¶,trail:~,nbsp:␣ + + +" Keeps everything concealed at all times. Even when my cursor is on the word. +set conceallevel=1 +set concealcursor=nvic + +" JavaScript thanks to pangloss/vim-javascript +let g:javascript_conceal_function = "ƒ" +match ErrorMsg /ƒ/ + + + +" keyword completion +inoremap ;; + + +" -- Syntastic Settings -- +set statusline+=%#warningmsg# +set statusline+=%{SyntasticStatuslineFlag()} +set statusline+=%* + +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 1 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 1 +let g:syntastic_javascript_checkers = ['gjslint'] + + +" Basic settings +syntax on +set number +set tabstop=2 +set expandtab +set shiftwidth=2 +colorscheme monokai +set t_Co=255 + + +" Ensure that
is "," character +let mapleader = "," + + +" Define highlighting groups +highlight InterestingWord1 ctermbg=Cyan ctermfg=Black +highlight InterestingWord2 ctermbg=Yellow ctermfg=Black +highlight InterestingWord3 ctermbg=Magenta ctermfg=Black + + +" h1 highlighting +nnoremap h1 :execute 'match InterestingWord1 /\<\>/' +nnoremap xh1 :execute 'match none' + +" h2 highlighting +nnoremap h2 :execute '2match InterestingWord2 /\<\>/' +nnoremap xh2 :execute '2match none' + +" h3 highlighting +nnoremap h3 :execute '3match InterestingWord3 /\<\>/' +nnoremap xh3 :execute '3match none' + +"clear all highlighted groups +nnoremap xhh :execute 'match none' :execute '2match none' :execute '3match none' + + +" add 80 character wrap line +highlight OverLength ctermbg=red ctermfg=white guibg=#592929 +match OverLength /\%81v.\+/ + + +" map jj to +imap jj + +" map ctrl + n to :NERDTree +map :NERDTreeToggle + + +" BOL and EOL +nnoremap H ^ +nnoremap L $ + + +" set -o emacs line-editor defaults +inoremap I +inoremap A + + +" trim trailing whitespace on save +autocmd BufWritePre *.{js,py,tpl,html} :%s/\s\+$//e + + +" set default font and size +set guifont=Operator\ Mono:h16 + + +" -- fuzzy-finder -- +set runtimepath^=~/.vim/bundle/ctrlp.vim +let g:ctrlp_map = '' +let g:ctrlp_cmd = 'CtrlP' +let g:ctrlp_custom_ignore = { + \ 'dir': 'node_modules' + \ } + diff --git a/usbify/vim/vim_point_to_usb.sh b/usbify/vim/vim_point_to_usb.sh new file mode 100755 index 000000000..7ea24fb0b --- /dev/null +++ b/usbify/vim/vim_point_to_usb.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +path_to_ext_device="/Volumes/usb_vim" + + +# ensure there is an external device connected and that the path to it is +# accurate. +if [ ! -d "$path_to_ext_device" ]; then + echo "No external device found at: $path_to_ext_device" + echo "Ensure that the value set for path_to_ext_device is correct." + echo "path_to_ext_device: $path_to_ext_device" + echo "Exiting." + return 1 +fi + + + +# This script toggles between local vim and a version that can be stored on an +# external device like a USB. + +# USB --> local machine +if [ -L "$HOME/.vim" ] && [ -L "$HOME/.vimrc" ]; then + echo "Pointing to USB. Toggling back to local machine..." + + # remove the symlinks + rm "$HOME/.vim" + rm "$HOME/.vimrc" + + # restore back-ups as active files + [ -d "$HOME/.vim.bak" ] && mv "$HOME/.vim.bak" "$HOME/.vim" + [ -f "$HOME/.vimrc.bak" ] && mv "$HOME/.vimrc.bak" "$HOME/.vimrc" + + echo ".vim now points to $HOME/.vim" + echo ".vimrc now points to $HOME/.vimrc" + +# local machine --> USB +else + echo "Pointing to local machine. Toggling to USB..." + + # back-up local machine's files + [ -d "$HOME/.vim" ] && mv "$HOME/.vim" "$HOME/.vim.bak" + [ -f "$HOME/.vimrc" ] && mv "$HOME/.vimrc" "$HOME/.vimrc.bak" + + # symlink .vim and .vimrc to external device + ln -s "${path_to_ext_device}/vim/.vim" "$HOME/.vim" + ln -s "${path_to_ext_device}/vim/.vimrc" "$HOME/.vimrc" + + echo ".vim now points to ${path_to_ext_device}/vim/.vim" +fi + +echo "Done." + From e3147857a09daacf8c19401f050f892bf009b141 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 30 Aug 2016 10:13:30 -0400 Subject: [PATCH 03/21] Adds pasteboard bindings --- usbify/vim/.vimrc | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index 604e39726..db8a40b4e 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -19,6 +19,7 @@ Plugin 'tpope/vim-fugitive' " All of your Plugins must be added before the following line Plugin 'Raimondi/delimitMate' Plugin 'Valloric/YouCompleteMe' +Plugin 'airblade/vim-gitgutter' Plugin 'kien/ctrlp.vim' Plugin 'mileszs/ack.vim' Plugin 'pangloss/vim-javascript' @@ -26,7 +27,7 @@ Plugin 'scrooloose/nerdtree' Plugin 'scrooloose/syntastic' Plugin 'sickill/vim-monokai' Plugin 'sjl/clam.vim' -Plugin 'airblade/vim-gitgutter' +Plugin 'terryma/vim-multiple-cursors' call vundle#end() " required @@ -64,8 +65,21 @@ set conceallevel=1 set concealcursor=nvic " JavaScript thanks to pangloss/vim-javascript -let g:javascript_conceal_function = "ƒ" -match ErrorMsg /ƒ/ +" let g:javascript_conceal_function = "ƒ" +" match ErrorMsg /ƒ/ + + +" Ultisnips +" Track the engine. +Plugin 'SirVer/ultisnips' + +" Snippets are separated from the engine. Add this if you want them: +Plugin 'honza/vim-snippets' + +" Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. +let g:UltiSnipsExpandTrigger="" +" let g:UltiSnipsJumpForwardTrigger="" +" let g:UltiSnipsJumpBackwardTrigger="" @@ -121,6 +135,13 @@ nnoremap xh3 :execute '3match none' nnoremap xhh :execute 'match none' :execute '2match none' :execute '3match none' +" pasteboard copy & paste +nnoremap V"+y +vnoremap "+y +nnoremap "+p +vnoremap "+p + + " add 80 character wrap line highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.\+/ From f6efe8ca2b20e58a056d7b4d8092b4ede1f3291d Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 21 Oct 2016 11:51:35 -0400 Subject: [PATCH 04/21] Adds new keybinds and bash functions for git --- functions/misc_functions.sh | 12 ++++++++++++ usbify/vim/.vimrc | 30 +++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/functions/misc_functions.sh b/functions/misc_functions.sh index 17c13d7a6..ed7f6293c 100644 --- a/functions/misc_functions.sh +++ b/functions/misc_functions.sh @@ -1,3 +1,15 @@ +# fuzzily-find-file +function wgff { + echo $(find . -type f | fzf) +} + + +# fuzzily-find-branch +function wgfb { + echo $(git branch -a | fzf) +} + + # download files to /tmp directory function wdownload { URL="$1" diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index db8a40b4e..ce78f2100 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -46,6 +46,12 @@ filetype plugin indent on " required " -- END: Vundle config -- +set noswapfile + + +set grepprg=ack\ -k + + " backspace settings set backspace=2 set backspace=indent,eol,start @@ -82,10 +88,28 @@ let g:UltiSnipsExpandTrigger="" " let g:UltiSnipsJumpBackwardTrigger="" - " keyword completion inoremap ;; +" tab movement bindings +nnoremap gT +nnoremap gt + +" scrolling and maintaing mouse position +nnoremap j +nnoremap k + + +" reload file after git changes +nnoremap :e + + +" resize vertical and horizontal splits +nnoremap :vertical resize +3 +nnoremap :vertical resize -3 +nnoremap :resize +3 +nnoremap :resize -3 + " -- Syntastic Settings -- set statusline+=%#warningmsg# @@ -105,7 +129,7 @@ set number set tabstop=2 set expandtab set shiftwidth=2 -colorscheme monokai +colorscheme elflord set t_Co=255 @@ -138,7 +162,7 @@ nnoremap xhh :execute 'match none' :execute '2match none' V"+y vnoremap "+y -nnoremap "+p +nnoremap o"+p vnoremap "+p From 1e8a01d8d18d982a095a16a8d0eebbda3e6e0c7a Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 4 Nov 2016 15:24:30 -0400 Subject: [PATCH 05/21] Adds new keybindings to vimrc --- usbify/vim/.vimrc | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index ce78f2100..42e4f20fc 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -91,10 +91,68 @@ let g:UltiSnipsExpandTrigger="" " keyword completion inoremap ;; + " tab movement bindings nnoremap gT nnoremap gt + +" make Y do what is intuitive given D, etc. +nnoremap Y y$ + + +" new tab keybinding +nnoremap :tabnew +inoremap :tabnew +vnoremap :tabnew + + +" flip number keys to their shift+ counterparts +nnoremap t1 t! +nnoremap t2 t@ +nnoremap t3 t# +nnoremap t4 t$ +nnoremap t5 t% +nnoremap t6 t^ +nnoremap t7 t& +nnoremap t8 t* +nnoremap t9 t( +nnoremap t0 t) + +nnoremap T1 T! +nnoremap T2 T@ +nnoremap T3 T# +nnoremap T4 T$ +nnoremap T5 T% +nnoremap T6 T^ +nnoremap T7 T& +nnoremap T8 T* +nnoremap T9 T( +nnoremap T0 T) + +nnoremap f1 f! +nnoremap f2 f@ +nnoremap f3 f# +nnoremap f4 f$ +nnoremap f5 f% +nnoremap f6 f^ +nnoremap f7 f& +nnoremap f8 f* +nnoremap f9 f( +nnoremap f0 f) + +nnoremap F1 F! +nnoremap F2 F@ +nnoremap F3 F# +nnoremap F4 F$ +nnoremap F5 F% +nnoremap F6 F^ +nnoremap F7 F& +nnoremap F8 F* +nnoremap F9 F( +nnoremap F0 F) + + " scrolling and maintaing mouse position nnoremap j nnoremap k @@ -162,6 +220,7 @@ nnoremap xhh :execute 'match none' :execute '2match none' V"+y vnoremap "+y + nnoremap o"+p vnoremap "+p From 0661c25246dd28a903ac1d17461974c67e050a4c Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 4 Nov 2016 16:12:41 -0400 Subject: [PATCH 06/21] Adds pasting commands and window controls --- usbify/vim/.vimrc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index 42e4f20fc..b98dc273c 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -27,6 +27,7 @@ Plugin 'scrooloose/nerdtree' Plugin 'scrooloose/syntastic' Plugin 'sickill/vim-monokai' Plugin 'sjl/clam.vim' +" NOTE: use to run miltiple cursors not Plugin 'terryma/vim-multiple-cursors' @@ -92,6 +93,17 @@ let g:UltiSnipsExpandTrigger="" inoremap ;; +" vs and sp keybinding +nnoremap vs :vs +nnoremap vv :vs +nnoremap sp :sp +nnoremap ss :sp + + +" Remap window keybinding +nnoremap + + " tab movement bindings nnoremap gT nnoremap gt @@ -153,6 +165,24 @@ nnoremap F9 F( nnoremap F0 F) +" Karate edits +nnoremap ca9 ca( +nnoremap da9 da( +nnoremap va9 va( + +nnoremap ca0 ca) +nnoremap da0 da) +nnoremap va0 va) + +nnoremap ci9 ci( +nnoremap di9 di( +nnoremap vi9 vi( + +nnoremap ci0 ci) +nnoremap di0 di) +nnoremap vi0 vi) + + " scrolling and maintaing mouse position nnoremap j nnoremap k @@ -221,6 +251,7 @@ nnoremap xhh :execute 'match none' :execute '2match none' V"+y vnoremap "+y +inoremap "+pa nnoremap o"+p vnoremap "+p From 6db646d789a490b243b5edad1703c71925118f88 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 4 Nov 2016 16:53:45 -0400 Subject: [PATCH 07/21] Adds additional bindings --- configs/.tmux.conf | 3 +++ configs/.zsh_profile | 4 ++++ usbify/vim/.vimrc | 32 ++++++++++++++++++++++++++------ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/configs/.tmux.conf b/configs/.tmux.conf index 45ef0596e..4e4099fef 100644 --- a/configs/.tmux.conf +++ b/configs/.tmux.conf @@ -1,15 +1,18 @@ set -g default-terminal "screen-256color" + bind-key -r -T prefix k select-pane -U bind-key -r -T prefix j select-pane -D bind-key -r -T prefix h select-pane -L bind-key -r -T prefix l select-pane -R + bind-key -r -T prefix C-k resize-p -U 2 bind-key -r -T prefix C-j resize-p -D 2 bind-key -r -T prefix C-h resize-p -L 2 bind-key -r -T prefix C-l resize-p -R 2 + bind % split-window -c "#{pane_current_path}" bind '"' split-window -h -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}" diff --git a/configs/.zsh_profile b/configs/.zsh_profile index 26da66d00..89eb0b738 100644 --- a/configs/.zsh_profile +++ b/configs/.zsh_profile @@ -39,3 +39,7 @@ bindkey -M viins 'jj' vi-cmd-mode # brew install zsh-syntax-highlighting source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +# Regain control of CLI +" remap lwi +inoremap lWi + +" TODO: debug why repetition is needed +inoremap bi +inoremap Bi + + +" set -o emacs line-editor defaults +inoremap I +inoremap A + + +" keybinds to close a buffer +inoremap :q +nnoremap :q +nnoremap :q + + " vs and sp keybinding nnoremap vs :vs nnoremap vv :vs @@ -217,10 +238,14 @@ set number set tabstop=2 set expandtab set shiftwidth=2 -colorscheme elflord +colorscheme monokai set t_Co=255 +" Remove all characters until the end of the line +inoremap lC + + " Ensure that
is "," character let mapleader = "," @@ -273,11 +298,6 @@ nnoremap H ^ nnoremap L $ -" set -o emacs line-editor defaults -inoremap I -inoremap A - - " trim trailing whitespace on save autocmd BufWritePre *.{js,py,tpl,html} :%s/\s\+$//e From 342779290a7a31389a97eb5fab01c624fc5b345a Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 4 Nov 2016 17:00:16 -0400 Subject: [PATCH 08/21] Adds visual mode support for H and L bindings --- usbify/vim/.vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index 42563ec96..7c2442c14 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -295,7 +295,9 @@ map :NERDTreeToggle " BOL and EOL nnoremap H ^ +vnoremap H ^ nnoremap L $ +vnoremap L $ " trim trailing whitespace on save From eee500b2aae5fcc6144385b3b67dba01a24fac96 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 7 Nov 2016 14:56:17 -0500 Subject: [PATCH 09/21] Adds solarized support --- configs/.tmux.conf | 2 ++ usbify/vim/.vimrc | 26 ++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/configs/.tmux.conf b/configs/.tmux.conf index 4e4099fef..00e9b750b 100644 --- a/configs/.tmux.conf +++ b/configs/.tmux.conf @@ -17,3 +17,5 @@ bind % split-window -c "#{pane_current_path}" bind '"' split-window -h -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}" +set -g default-terminal "screen-256color-italic" + diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index 7c2442c14..c4ebeb098 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -25,7 +25,10 @@ Plugin 'mileszs/ack.vim' Plugin 'pangloss/vim-javascript' Plugin 'scrooloose/nerdtree' Plugin 'scrooloose/syntastic' + Plugin 'sickill/vim-monokai' +Plugin 'altercation/vim-colors-solarized' + Plugin 'sjl/clam.vim' " NOTE: use to run miltiple cursors not Plugin 'terryma/vim-multiple-cursors' @@ -108,12 +111,6 @@ inoremap I inoremap A -" keybinds to close a buffer -inoremap :q -nnoremap :q -nnoremap :q - - " vs and sp keybinding nnoremap vs :vs nnoremap vv :vs @@ -233,15 +230,28 @@ let g:syntastic_javascript_checkers = ['gjslint'] " Basic settings -syntax on set number set tabstop=2 set expandtab set shiftwidth=2 -colorscheme monokai + +syntax enable + +if has('gui_running') + set background=light +else + set background=dark +endif + +colorscheme solarized + set t_Co=255 +" Support italics +highlight Comment cterm=italic + + " Remove all characters until the end of the line inoremap lC From 1870aadddbaee0132e94006cd1bec5b315e1a4fe Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 8 Nov 2016 14:50:17 -0500 Subject: [PATCH 10/21] Reassigned leader; removes dead code; adds new mappings --- usbify/vim/.vimrc | 180 +++++++++++++++++++++++++--------------------- 1 file changed, 99 insertions(+), 81 deletions(-) diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index c4ebeb098..9ddfe6d41 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -13,12 +13,16 @@ Plugin 'VundleVim/Vundle.vim' " The following are examples of different formats supported. " Keep Plugin commands between vundle#begin/end. -" plugin on GitHub repo + +" Displays git information in airline. Plugin 'tpope/vim-fugitive' -" All of your Plugins must be added before the following line Plugin 'Raimondi/delimitMate' + +" Autocompletion Plugin 'Valloric/YouCompleteMe' + +" Displays git-tracked C*UD ops within gutter. Plugin 'airblade/vim-gitgutter' Plugin 'kien/ctrlp.vim' Plugin 'mileszs/ack.vim' @@ -26,34 +30,49 @@ Plugin 'pangloss/vim-javascript' Plugin 'scrooloose/nerdtree' Plugin 'scrooloose/syntastic' +" Themes Plugin 'sickill/vim-monokai' Plugin 'altercation/vim-colors-solarized' +" Executes shell commands and pipes output into new Vim buffer. Plugin 'sjl/clam.vim' + +" Multiple cursors for simultaneous edits. " NOTE: use to run miltiple cursors not Plugin 'terryma/vim-multiple-cursors' +" Visualize buffers +Plugin 'vim-airline/vim-airline' +Plugin 'vim-airline/vim-airline-themes' + call vundle#end() " required filetype plugin indent on " required -" To ignore plugin indent changes, instead use: -"filetype plugin on -" -" Brief help -" :PluginList - lists configured plugins -" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate -" :PluginSearch foo - searches for foo; append `!` to refresh local cache -" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal -" -" see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line " -- END: Vundle config -- +" Airline Settings +" Enables the list of buffers. +let g:airline#extensions#tabline#enabled = 1 + +" Shows the filename only. +let g:airline#extensions#tabline#fnamemod = ':t' + +" Allow glyphs in airline +let g:airline_powerline_fonts = 1 + + +" It's the twenty-first century...no swaps. set noswapfile -set grepprg=ack\ -k +" Changes to character. +let mapleader = " " + + +" Supports mouse interaction. +set mouse=a " backspace settings @@ -70,7 +89,7 @@ set list set listchars=eol:¶,trail:~,nbsp:␣ -" Keeps everything concealed at all times. Even when my cursor is on the word. +" Keeps everything concealed at all times. Even when cursor is on the word. set conceallevel=1 set concealcursor=nvic @@ -92,51 +111,36 @@ let g:UltiSnipsExpandTrigger="" " let g:UltiSnipsJumpBackwardTrigger="" -" keyword completion -inoremap ;; - - -" remap lwi -inoremap lWi - -" TODO: debug why repetition is needed -inoremap bi -inoremap Bi - - -" set -o emacs line-editor defaults +" Conventional Emacs line-editor defaults inoremap I inoremap A -" vs and sp keybinding +" Manage Vertical and Horizontal splits nnoremap vs :vs nnoremap vv :vs nnoremap sp :sp nnoremap ss :sp -" Remap window keybinding -nnoremap +" Buffer creation and management +" Buffer movement +nnoremap :1bnext +nnoremap :1bprevious + +" Buffer creation +nnoremap :enew + +" Buffer deletion +nnoremap bq :bp bd # -" tab movement bindings -nnoremap gT -nnoremap gt - - -" make Y do what is intuitive given D, etc. +" make Y do what is intuitive given: +" D: deletes until EOL +" C: changes until EOL nnoremap Y y$ -" new tab keybinding -nnoremap :tabnew -inoremap :tabnew -vnoremap :tabnew - - " flip number keys to their shift+ counterparts nnoremap t1 t! nnoremap t2 t@ @@ -210,13 +214,6 @@ nnoremap k nnoremap :e -" resize vertical and horizontal splits -nnoremap :vertical resize +3 -nnoremap :vertical resize -3 -nnoremap :resize +3 -nnoremap :resize -3 - - " -- Syntastic Settings -- set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} @@ -236,13 +233,7 @@ set expandtab set shiftwidth=2 syntax enable - -if has('gui_running') - set background=light -else - set background=dark -endif - +set background=dark colorscheme solarized set t_Co=255 @@ -256,30 +247,27 @@ highlight Comment cterm=italic inoremap lC -" Ensure that
is "," character -let mapleader = "," - - " Define highlighting groups -highlight InterestingWord1 ctermbg=Cyan ctermfg=Black -highlight InterestingWord2 ctermbg=Yellow ctermfg=Black +" NOTE: The ANSII aliases for colors will change when iTerm2 settings are +" changed. +highlight InterestingWord1 ctermbg=White ctermfg=Black +highlight InterestingWord2 ctermbg=Blue ctermfg=Black highlight InterestingWord3 ctermbg=Magenta ctermfg=Black - " h1 highlighting -nnoremap h1 :execute 'match InterestingWord1 /\<\>/' -nnoremap xh1 :execute 'match none' +nnoremap 1 :execute 'match InterestingWord1 /\<\>/' +nnoremap x1 :execute 'match none' " h2 highlighting -nnoremap h2 :execute '2match InterestingWord2 /\<\>/' -nnoremap xh2 :execute '2match none' +nnoremap 2 :execute '2match InterestingWord2 /\<\>/' +nnoremap x2 :execute '2match none' " h3 highlighting -nnoremap h3 :execute '3match InterestingWord3 /\<\>/' -nnoremap xh3 :execute '3match none' +nnoremap 3 :execute '3match InterestingWord3 /\<\>/' +nnoremap x3 :execute '3match none' "clear all highlighted groups -nnoremap xhh :execute 'match none' :execute '2match none' :execute '3match none' +nnoremap xx :execute 'match none' :execute '2match none' :execute '3match none' " pasteboard copy & paste @@ -291,16 +279,35 @@ nnoremap o"+p vnoremap "+p -" add 80 character wrap line -highlight OverLength ctermbg=red ctermfg=white guibg=#592929 +" Manage 80 char line limits +highlight OverLength ctermbg=White ctermfg=Black match OverLength /\%81v.\+/ +set wrap! + + +" Toggle word-wrapping +nnoremap w :set wrap! + + +" Resize split to 10,20,...,100 chars +nnoremap 1 :vertical resize 10 +nnoremap 2 :vertical resize 20 +nnoremap 3 :vertical resize 30 +nnoremap 4 :vertical resize 40 +nnoremap 5 :vertical resize 50 +nnoremap 6 :vertical resize 60 +nnoremap 7 :vertical resize 70 +nnoremap 8 :vertical resize 80 +nnoremap 9 :vertical resize 90 +nnoremap 0 :vertical resize 100 " map jj to imap jj -" map ctrl + n to :NERDTree -map :NERDTreeToggle + +" View Directory tree with ctrl + \ +nnoremap :NERDTreeToggle " BOL and EOL @@ -318,11 +325,22 @@ autocmd BufWritePre *.{js,py,tpl,html} :%s/\s\+$//e set guifont=Operator\ Mono:h16 -" -- fuzzy-finder -- +" CtrlP Config. set runtimepath^=~/.vim/bundle/ctrlp.vim -let g:ctrlp_map = '' +" let g:ctrlp_map = '' let g:ctrlp_cmd = 'CtrlP' -let g:ctrlp_custom_ignore = { - \ 'dir': 'node_modules' - \ } + +" Maps CtrlP to leader to future-proof config. +nnoremap p :CtrlP + +" Fuzzy-finds files within cwd. +" nnoremap pf :CtrlP +" Fuzzy-finds files within open buffers. +" nnoremap pb :CtrlPBuffer + +" Ignores dirs and files +let g:ctrlp_custom_ignore = { + \ 'dir': 'node_modules', + \ 'file': '\v\.(exe|dll|png|jpg|jpeg)$' +\} From ce6d38c5e87a99cc8369f65af82236634823e71f Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 8 Nov 2016 15:10:34 -0500 Subject: [PATCH 11/21] Remaps leader key to C-w for window mgt --- usbify/vim/.vimrc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index 9ddfe6d41..54ea2f709 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -123,6 +123,17 @@ nnoremap sp :sp nnoremap ss :sp +" Move around splits with +nnoremap h h +nnoremap j j +nnoremap k k +nnoremap l l + + +" Fuzzy-find open buffer via CtrlP +nnoremap bg :CtrlPBuffer + + " Buffer creation and management " Buffer movement nnoremap :1bnext @@ -335,8 +346,6 @@ nnoremap p :CtrlP " Fuzzy-finds files within cwd. " nnoremap pf :CtrlP -" Fuzzy-finds files within open buffers. -" nnoremap pb :CtrlPBuffer " Ignores dirs and files let g:ctrlp_custom_ignore = { From 251c7d72b955bdcd79870fa0d7b508e8b67792a3 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 9 Nov 2016 12:14:08 -0500 Subject: [PATCH 12/21] Changes mapping and updates highlighting features --- usbify/vim/.vimrc | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index 54ea2f709..236d79bc0 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -75,6 +75,12 @@ let mapleader = " " set mouse=a +" Highlights matches during a search. +set hlsearch + +nnoremap / :set hlsearch! + + " backspace settings set backspace=2 set backspace=indent,eol,start @@ -111,6 +117,10 @@ let g:UltiSnipsExpandTrigger="" " let g:UltiSnipsJumpBackwardTrigger="" +" map jk to +inoremap jk + + " Conventional Emacs line-editor defaults inoremap I inoremap A @@ -128,6 +138,7 @@ nnoremap h h nnoremap j j nnoremap k k nnoremap l l +nnoremap q q " Fuzzy-find open buffer via CtrlP @@ -254,31 +265,22 @@ set t_Co=255 highlight Comment cterm=italic -" Remove all characters until the end of the line -inoremap lC - - " Define highlighting groups " NOTE: The ANSII aliases for colors will change when iTerm2 settings are " changed. -highlight InterestingWord1 ctermbg=White ctermfg=Black +highlight InterestingWord1 ctermbg=Magenta ctermfg=Black highlight InterestingWord2 ctermbg=Blue ctermfg=Black -highlight InterestingWord3 ctermbg=Magenta ctermfg=Black " h1 highlighting -nnoremap 1 :execute 'match InterestingWord1 /\<\>/' -nnoremap x1 :execute 'match none' +nnoremap 1 :execute '2match InterestingWord1 /\<\>/' +nnoremap x1 :execute '2match none' " h2 highlighting -nnoremap 2 :execute '2match InterestingWord2 /\<\>/' -nnoremap x2 :execute '2match none' - -" h3 highlighting -nnoremap 3 :execute '3match InterestingWord3 /\<\>/' -nnoremap x3 :execute '3match none' +nnoremap 2 :execute '3match InterestingWord2 /\<\>/' +nnoremap x2 :execute '3match none' "clear all highlighted groups -nnoremap xx :execute 'match none' :execute '2match none' :execute '3match none' +nnoremap xx :execute '2match none' :execute '3match none' hh " pasteboard copy & paste @@ -301,8 +303,10 @@ nnoremap w :set wrap! " Resize split to 10,20,...,100 chars -nnoremap 1 :vertical resize 10 -nnoremap 2 :vertical resize 20 +" Uncomment the next lines for support at those sizes. +" These bindings interfere with the highlight groups, however. +" nnoremap 1 :vertical resize 10 +" nnoremap 2 :vertical resize 20 nnoremap 3 :vertical resize 30 nnoremap 4 :vertical resize 40 nnoremap 5 :vertical resize 50 @@ -313,10 +317,6 @@ nnoremap 9 :vertical resize 90 nnoremap 0 :vertical resize 100 -" map jj to -imap jj - - " View Directory tree with ctrl + \ nnoremap :NERDTreeToggle From ccd11f71971cfabd9f61666f403161a553266693 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 10 Nov 2016 10:57:18 -0500 Subject: [PATCH 13/21] Updates config to support ctags --- configs/.ctags | 89 ++++++++++++++++++++++++++++++++++++++++ configs/setup_configs.sh | 21 +++++++++- usbify/vim/.vimrc | 23 +++++++++++ 3 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 configs/.ctags diff --git a/configs/.ctags b/configs/.ctags new file mode 100644 index 000000000..7899e7a21 --- /dev/null +++ b/configs/.ctags @@ -0,0 +1,89 @@ +--recurse=yes +--exclude=.git +--exclude=vendor/ +--exclude=node_modules +--exclude=db +--exclude=log +--exclude=tmp + + +--regex-ruby=/.*alias(_method)?[[:space:]]+:([[:alnum:]_=!?]+),?[[:space:]]+:([[:alnum:]_=!]+)/\2/f,function/ +--regex-ruby=/(^|[:;])[ \t]*([A-Z][[:alnum:]_]+) *=/\2/c,class,constant/ +--regex-ruby=/(^|;)[ \t]*(has_many|belongs_to|has_one|has_and_belongs_to_many)\(? *:([[:alnum:]_]+)/\3/f,function,association/ +--regex-ruby=/(^|;)[ \t]*(named_)?scope\(? *:([[:alnum:]_]+)/\3/f,function,named_scope/ +--regex-ruby=/(^|;)[ \t]*expose\(? *:([[:alnum:]_]+)/\2/f,function,exposure/ +--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2/f,function,aasm_event/ +--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2!/f,function,aasm_event/ +--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2?/f,function,aasm_event/ + +--langmap=Ruby:+(Rakefile) + +--langdef=js +--langmap=js:.js +--langmap=js:+.jsx + +--regex-js=/[ \t.]([A-Z][A-Z0-9._$]+)[ \t]*[=:][ \t]*([0-9"'\[\{]|null)/\1/n,constant/ + +--regex-js=/\.([A-Za-z0-9._$]+)[ \t]*=[ \t]*\{/\1/o,object/ +--regex-js=/['"]*([A-Za-z0-9_$]+)['"]*[ \t]*:[ \t]*\{/\1/o,object/ +--regex-js=/([A-Za-z0-9._$]+)\[["']([A-Za-z0-9_$]+)["']\][ \t]*=[ \t]*\{/\1\.\2/o,object/ + +--regex-js=/([A-Za-z0-9._$]+)[ \t]*=[ \t]*\(function\(\)/\1/c,class/ +--regex-js=/['"]*([A-Za-z0-9_$]+)['"]*:[ \t]*\(function\(\)/\1/c,class/ +--regex-js=/class[ \t]+([A-Za-z0-9._$]+)[ \t]*/\1/c,class/ +--regex-js=/([A-Za-z$][A-Za-z0-9_$()]+)[ \t]*=[ \t]*[Rr]eact.createClass[ \t]*\(/\1/c,class/ +--regex-js=/([A-Z][A-Za-z0-9_$]+)[ \t]*=[ \t]*[A-Za-z0-9_$]*[ \t]*[{(]/\1/c,class/ +--regex-js=/([A-Z][A-Za-z0-9_$]+)[ \t]*:[ \t]*[A-Za-z0-9_$]*[ \t]*[{(]/\1/c,class/ + +--regex-js=/([A-Za-z$][A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\1/f,function/ + +--regex-js=/(function)*[ \t]*([A-Za-z$_][A-Za-z0-9_$]+)[ \t]*\([^)]*\)[ \t]*\{/\2/f,function/ +--regex-js=/['"]*([A-Za-z$][A-Za-z0-9_$]+)['"]*:[ \t]*function[ \t]*\(/\1/m,method/ +--regex-js=/([A-Za-z0-9_$]+)\[["']([A-Za-z0-9_$]+)["']\][ \t]*=[ \t]*function[ \t]*\(/\2/m,method/ + + +--langdef=haskell +--langmap=haskell:.hs +--regex-haskell=/^module[ \t]*([A-Z][a-zA-Z0-9'_.]*)/\1/m,module/ +--regex-haskell=/^(new)?type[ \t]*([A-Z][a-zA-Z0-9'_]*)./\2/t,type/ +--regex-haskell=/^class[ \t]*([A-Z][a-zA-Z0-9'_]*)/\1/c,class/ +--regex-haskell=/^data[ \t]*([A-Z][a-zA-Z0-9'_]*)/\1/d,data/ +--regex-haskell=/^([a-z_][a-zA-Z0-9'_]*).*=/\1/v,function/ + +--langmap=C++:+.mm + +--langdef=golang +--langmap=golang:.go +--regex-golang=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/ +--regex-golang=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/ +--regex-golang=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/ + +--langdef=Rust +--langmap=Rust:.rs +--regex-Rust=/^[ \t]*(#\[[^\]]\][ \t]*)*(pub[ \t]+)?(extern[ \t]+)?("[^"]+"[ \t]+)?(unsafe[ \t]+)?fn[ \t]+([a-zA-Z0-9_]+)/\6/f,functions,function definitions/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?type[ \t]+([a-zA-Z0-9_]+)/\2/T,types,type definitions/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?enum[ \t]+([a-zA-Z0-9_]+)/\2/g,enum,enumeration names/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?struct[ \t]+([a-zA-Z0-9_]+)/\2/s,structure names/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?mod[ \t]+([a-zA-Z0-9_]+)/\2/m,modules,module names/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?static[ \t]+([a-zA-Z0-9_]+)/\2/c,consts,static constants/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?trait[ \t]+([a-zA-Z0-9_]+)/\2/t,traits,traits/ +--regex-Rust=/^[ \t]*(pub[ \t]+)?impl([ \t\n]*<[^>]*>)?[ \t]+(([a-zA-Z0-9_:]+)[ \t]*(<[^>]*>)?[ \t]+(for)[ \t]+)?([a-zA-Z0-9_]+)/\4 \6 \7/i,impls,trait implementations/ +--regex-Rust=/^[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\1/d,macros,macro definitions/ + +--langdef=typescript +--langmap=typescript:.ts +--regex-typescript=/^[ \t]*(export)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\2/c,classes/ +--regex-typescript=/^[ \t]*(export)?[ \t]*module[ \t]+([a-zA-Z0-9_]+)/\2/n,modules/ +--regex-typescript=/^[ \t]*(export)?[ \t]*function[ \t]+([a-zA-Z0-9_]+)/\2/f,functions/ +--regex-typescript=/^[ \t]*export[ \t]+var[ \t]+([a-zA-Z0-9_]+)/\1/v,variables/ +--regex-typescript=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)[ \t]*=[ \t]*function[ \t]*\(\)/\1/v,varlambdas/ +--regex-typescript=/^[ \t]*(export)?[ \t]*(public|private)[ \t]+(static)?[ \t]*([a-zA-Z0-9_]+)/\4/m,members/ +--regex-typescript=/^[ \t]*(export)?[ \t]*interface[ \t]+([a-zA-Z0-9_]+)/\2/i,interfaces/ +--regex-typescript=/^[ \t]*(export)?[ \t]*enum[ \t]+([a-zA-Z0-9_]+)/\2/e,enums/ +--regex-typescript=/^[ \t]*import[ \t]+([a-zA-Z0-9_]+)/\1/I,imports/ + +--langdef=elm +--langmap=elm:.elm +--regex-elm=/^module[ \t]*([A-Z][a-zA-Z0-9'_.]*)/\1/m,module/ +--regex-elm=/^type[ \t]*([A-Z][a-zA-Z0-9'_]*)./\1/t,type/ +--regex-elm=/^([a-z_][a-zA-Z0-9'_]*).*=/\1/v,function/ diff --git a/configs/setup_configs.sh b/configs/setup_configs.sh index e1a742c4b..2dbe15e11 100755 --- a/configs/setup_configs.sh +++ b/configs/setup_configs.sh @@ -20,7 +20,7 @@ else fi -# backup .tmux.conf +# .tmux.conf if [ -f "$HOME"/.tmux.conf ] && [ ! -L "$HOME"/.tmux.conf ]; then echo -n "Backing up .tmux.conf ... " && \ mv "$HOME"/.tmux.conf "$HOME"/.tmux.conf.bak && \ @@ -37,3 +37,22 @@ else echo "Done." fi + +# .ctags +if [ -f "$HOME"/.ctags ] && [ ! -L "$HOME"/.ctags ]; then + # backup .ctags + echo -n "Backing up .ctags ... " && \ + mv "$HOME"/.ctags "$HOME"/.ctags.bak && \ + echo "Done." +fi + +if [ -L "$HOME"/.ctags ]; then + # TODO: make sure that .ctags is symlinked to the correct location. + echo ".ctags is already symlinked." +else + # create symlink to pc_settings .ctags + echo -n "Symlinking to pc_settings/configs/.ctags ... " && \ + ln -s "$HOME"/pc_settings/configs/.ctags "$HOME"/.ctags && \ + echo "Done." +fi + diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index 236d79bc0..151391950 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -67,6 +67,14 @@ let g:airline_powerline_fonts = 1 set noswapfile +" Allow visual tab completion in command mode +set wildmenu + + +" Show Vim commands as they're being input. +set showcmd + + " Changes to character. let mapleader = " " @@ -81,6 +89,10 @@ set hlsearch nnoremap / :set hlsearch! +" Use custom-made snippets. +nnoremap ,jsfn :-1read $HOME/.vim/function_skeleton.jso + + " backspace settings set backspace=2 set backspace=indent,eol,start @@ -305,6 +317,7 @@ nnoremap w :set wrap! " Resize split to 10,20,...,100 chars " Uncomment the next lines for support at those sizes. " These bindings interfere with the highlight groups, however. +" Increases the width of a vertical split. " nnoremap 1 :vertical resize 10 " nnoremap 2 :vertical resize 20 nnoremap 3 :vertical resize 30 @@ -316,6 +329,16 @@ nnoremap 8 :vertical resize 80 nnoremap 9 :vertical resize 90 nnoremap 0 :vertical resize 100 +" Increases the height of a horizontal split. +nnoremap v1 :resize 5 +nnoremap v2 :resize 10 +nnoremap v3 :resize 15 +nnoremap v4 :resize 20 +nnoremap v5 :resize 25 +nnoremap v6 :resize 30 +nnoremap v7 :resize 35 +nnoremap v8 :resize 40 + " View Directory tree with ctrl + \ nnoremap :NERDTreeToggle From b24cfc36cd8c0e5919f102c60a036c4e91ab540f Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 10 Nov 2016 11:47:44 -0500 Subject: [PATCH 14/21] Refactors script to use array --- configs/setup_configs.sh | 70 ++++++++++++---------------------------- 1 file changed, 21 insertions(+), 49 deletions(-) diff --git a/configs/setup_configs.sh b/configs/setup_configs.sh index 2dbe15e11..717625934 100755 --- a/configs/setup_configs.sh +++ b/configs/setup_configs.sh @@ -1,58 +1,30 @@ #!/usr/bin/env bash -# .zsh_profile -if [ -f "$HOME"/.zsh_profile ] && [ ! -L "$HOME"/.zsh_profile ]; then - # backup .zsh_profile - echo -n "Backing up .zsh_profile ... " && \ - mv "$HOME"/.zsh_profile "$HOME"/.zsh_profile.bak && \ - echo "Done." -fi - -if [ -L "$HOME"/.zsh_profile ]; then - # TODO: make sure that .zsh_profile is symlinked to the correct location. - echo ".zsh_profile is already symlinked." -else - # create symlink to pc_settings .zsh_profile - echo -n "Symlinking to pc_settings/configs/.zsh_profile ... " && \ - ln -s "$HOME"/pc_settings/configs/.zsh_profile "$HOME"/.zsh_profile && \ - echo "Done." -fi +pc_settings_path="$HOME/pc_settings" -# .tmux.conf -if [ -f "$HOME"/.tmux.conf ] && [ ! -L "$HOME"/.tmux.conf ]; then - echo -n "Backing up .tmux.conf ... " && \ - mv "$HOME"/.tmux.conf "$HOME"/.tmux.conf.bak && \ - echo "Done." -fi - -if [ -L "$HOME"/.tmux.conf ]; then - # TODO: make sure that .tmux.conf is symlinked to the correct location. - echo ".tmux.conf is already symlinked." -else - # create symlink to pc_settings .tmux.conf - echo -n "Symlinking to pc_settings/configs/.tmux.conf ... " && \ - ln -s "$HOME"/pc_settings/configs/.tmux.conf "$HOME"/.tmux.conf && \ - echo "Done." -fi +config_files=( ".zsh_profile" ".tmux.conf" ".ctags" ) -# .ctags -if [ -f "$HOME"/.ctags ] && [ ! -L "$HOME"/.ctags ]; then - # backup .ctags - echo -n "Backing up .ctags ... " && \ - mv "$HOME"/.ctags "$HOME"/.ctags.bak && \ - echo "Done." -fi +for i in {1..3}; do + cf="${config_files[i]}" + if [ -f "$HOME/$cf" ] && [ ! -L "$HOME/$cf" ]; then + echo -n "Backing up $cf ... " && \ + mv "$HOME/$cf" "$HOME/$cf.bak" && \ + echo "Done." + fi -if [ -L "$HOME"/.ctags ]; then - # TODO: make sure that .ctags is symlinked to the correct location. - echo ".ctags is already symlinked." -else - # create symlink to pc_settings .ctags - echo -n "Symlinking to pc_settings/configs/.ctags ... " && \ - ln -s "$HOME"/pc_settings/configs/.ctags "$HOME"/.ctags && \ - echo "Done." -fi + if [ -L "$HOME/$cf" ]; then + if [ $(readlink "$HOME/$cf") = "$pc_settings_path/configs/$cf" ]; then + echo "\"$cf\" is already properly symlinked to \"$pc_settings_path/configs\"." + else + echo "\"$cf\" is symlinked but not to the proper location." + fi + else + echo -n "Symlinking to $pc_settings_path/configs/$cf ... " && \ + ln -s "$pc_settings_path/configs/$cf" "$HOME/$cf" && \ + echo "Done." + fi +done From bd968db34aff0d9a03b22257ec5a860d4c85946a Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 10 Nov 2016 12:12:45 -0500 Subject: [PATCH 15/21] Adds vim config to script --- configs/.vimrc | 378 +++++++++++++++++++++++++++++++++++++++ configs/setup_configs.sh | 15 +- 2 files changed, 389 insertions(+), 4 deletions(-) create mode 100644 configs/.vimrc diff --git a/configs/.vimrc b/configs/.vimrc new file mode 100644 index 000000000..151391950 --- /dev/null +++ b/configs/.vimrc @@ -0,0 +1,378 @@ +" -- BEGIN: Vundle config -- +set nocompatible " be iMproved, required +filetype off " required + +" set the runtime path to include Vundle and initialize +set rtp+=~/.vim/bundle/Vundle.vim +call vundle#begin() +" alternatively, pass a path where Vundle should install plugins +"call vundle#begin('~/some/path/here') + +" let Vundle manage Vundle, required +Plugin 'VundleVim/Vundle.vim' + +" The following are examples of different formats supported. +" Keep Plugin commands between vundle#begin/end. + +" Displays git information in airline. +Plugin 'tpope/vim-fugitive' + +Plugin 'Raimondi/delimitMate' + +" Autocompletion +Plugin 'Valloric/YouCompleteMe' + +" Displays git-tracked C*UD ops within gutter. +Plugin 'airblade/vim-gitgutter' +Plugin 'kien/ctrlp.vim' +Plugin 'mileszs/ack.vim' +Plugin 'pangloss/vim-javascript' +Plugin 'scrooloose/nerdtree' +Plugin 'scrooloose/syntastic' + +" Themes +Plugin 'sickill/vim-monokai' +Plugin 'altercation/vim-colors-solarized' + +" Executes shell commands and pipes output into new Vim buffer. +Plugin 'sjl/clam.vim' + +" Multiple cursors for simultaneous edits. +" NOTE: use to run miltiple cursors not +Plugin 'terryma/vim-multiple-cursors' + +" Visualize buffers +Plugin 'vim-airline/vim-airline' +Plugin 'vim-airline/vim-airline-themes' + + +call vundle#end() " required +filetype plugin indent on " required +" Put your non-Plugin stuff after this line +" -- END: Vundle config -- + + +" Airline Settings +" Enables the list of buffers. +let g:airline#extensions#tabline#enabled = 1 + +" Shows the filename only. +let g:airline#extensions#tabline#fnamemod = ':t' + +" Allow glyphs in airline +let g:airline_powerline_fonts = 1 + + +" It's the twenty-first century...no swaps. +set noswapfile + + +" Allow visual tab completion in command mode +set wildmenu + + +" Show Vim commands as they're being input. +set showcmd + + +" Changes to character. +let mapleader = " " + + +" Supports mouse interaction. +set mouse=a + + +" Highlights matches during a search. +set hlsearch + +nnoremap / :set hlsearch! + + +" Use custom-made snippets. +nnoremap ,jsfn :-1read $HOME/.vim/function_skeleton.jso + + +" backspace settings +set backspace=2 +set backspace=indent,eol,start + + +" Javascript specific variables +let g:javascript_plugin_jsdoc = 1 +" set foldmethod=syntax + +" GlobalListchars +set list +set listchars=eol:¶,trail:~,nbsp:␣ + + +" Keeps everything concealed at all times. Even when cursor is on the word. +set conceallevel=1 +set concealcursor=nvic + +" JavaScript thanks to pangloss/vim-javascript +" let g:javascript_conceal_function = "ƒ" +" match ErrorMsg /ƒ/ + + +" Ultisnips +" Track the engine. +Plugin 'SirVer/ultisnips' + +" Snippets are separated from the engine. Add this if you want them: +Plugin 'honza/vim-snippets' + +" Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. +let g:UltiSnipsExpandTrigger="" +" let g:UltiSnipsJumpForwardTrigger="" +" let g:UltiSnipsJumpBackwardTrigger="" + + +" map jk to +inoremap jk + + +" Conventional Emacs line-editor defaults +inoremap I +inoremap A + + +" Manage Vertical and Horizontal splits +nnoremap vs :vs +nnoremap vv :vs +nnoremap sp :sp +nnoremap ss :sp + + +" Move around splits with +nnoremap h h +nnoremap j j +nnoremap k k +nnoremap l l +nnoremap q q + + +" Fuzzy-find open buffer via CtrlP +nnoremap bg :CtrlPBuffer + + +" Buffer creation and management +" Buffer movement +nnoremap :1bnext +nnoremap :1bprevious + +" Buffer creation +nnoremap :enew + +" Buffer deletion +nnoremap bq :bp bd # + + +" make Y do what is intuitive given: +" D: deletes until EOL +" C: changes until EOL +nnoremap Y y$ + + +" flip number keys to their shift+ counterparts +nnoremap t1 t! +nnoremap t2 t@ +nnoremap t3 t# +nnoremap t4 t$ +nnoremap t5 t% +nnoremap t6 t^ +nnoremap t7 t& +nnoremap t8 t* +nnoremap t9 t( +nnoremap t0 t) + +nnoremap T1 T! +nnoremap T2 T@ +nnoremap T3 T# +nnoremap T4 T$ +nnoremap T5 T% +nnoremap T6 T^ +nnoremap T7 T& +nnoremap T8 T* +nnoremap T9 T( +nnoremap T0 T) + +nnoremap f1 f! +nnoremap f2 f@ +nnoremap f3 f# +nnoremap f4 f$ +nnoremap f5 f% +nnoremap f6 f^ +nnoremap f7 f& +nnoremap f8 f* +nnoremap f9 f( +nnoremap f0 f) + +nnoremap F1 F! +nnoremap F2 F@ +nnoremap F3 F# +nnoremap F4 F$ +nnoremap F5 F% +nnoremap F6 F^ +nnoremap F7 F& +nnoremap F8 F* +nnoremap F9 F( +nnoremap F0 F) + + +" Karate edits +nnoremap ca9 ca( +nnoremap da9 da( +nnoremap va9 va( + +nnoremap ca0 ca) +nnoremap da0 da) +nnoremap va0 va) + +nnoremap ci9 ci( +nnoremap di9 di( +nnoremap vi9 vi( + +nnoremap ci0 ci) +nnoremap di0 di) +nnoremap vi0 vi) + + +" scrolling and maintaing mouse position +nnoremap j +nnoremap k + + +" reload file after git changes +nnoremap :e + + +" -- Syntastic Settings -- +set statusline+=%#warningmsg# +set statusline+=%{SyntasticStatuslineFlag()} +set statusline+=%* + +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 1 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 1 +let g:syntastic_javascript_checkers = ['gjslint'] + + +" Basic settings +set number +set tabstop=2 +set expandtab +set shiftwidth=2 + +syntax enable +set background=dark +colorscheme solarized + +set t_Co=255 + + +" Support italics +highlight Comment cterm=italic + + +" Define highlighting groups +" NOTE: The ANSII aliases for colors will change when iTerm2 settings are +" changed. +highlight InterestingWord1 ctermbg=Magenta ctermfg=Black +highlight InterestingWord2 ctermbg=Blue ctermfg=Black + +" h1 highlighting +nnoremap 1 :execute '2match InterestingWord1 /\<\>/' +nnoremap x1 :execute '2match none' + +" h2 highlighting +nnoremap 2 :execute '3match InterestingWord2 /\<\>/' +nnoremap x2 :execute '3match none' + +"clear all highlighted groups +nnoremap xx :execute '2match none' :execute '3match none' hh + + +" pasteboard copy & paste +nnoremap V"+y +vnoremap "+y + +inoremap "+pa +nnoremap o"+p +vnoremap "+p + + +" Manage 80 char line limits +highlight OverLength ctermbg=White ctermfg=Black +match OverLength /\%81v.\+/ +set wrap! + + +" Toggle word-wrapping +nnoremap w :set wrap! + + +" Resize split to 10,20,...,100 chars +" Uncomment the next lines for support at those sizes. +" These bindings interfere with the highlight groups, however. +" Increases the width of a vertical split. +" nnoremap 1 :vertical resize 10 +" nnoremap 2 :vertical resize 20 +nnoremap 3 :vertical resize 30 +nnoremap 4 :vertical resize 40 +nnoremap 5 :vertical resize 50 +nnoremap 6 :vertical resize 60 +nnoremap 7 :vertical resize 70 +nnoremap 8 :vertical resize 80 +nnoremap 9 :vertical resize 90 +nnoremap 0 :vertical resize 100 + +" Increases the height of a horizontal split. +nnoremap v1 :resize 5 +nnoremap v2 :resize 10 +nnoremap v3 :resize 15 +nnoremap v4 :resize 20 +nnoremap v5 :resize 25 +nnoremap v6 :resize 30 +nnoremap v7 :resize 35 +nnoremap v8 :resize 40 + + +" View Directory tree with ctrl + \ +nnoremap :NERDTreeToggle + + +" BOL and EOL +nnoremap H ^ +vnoremap H ^ +nnoremap L $ +vnoremap L $ + + +" trim trailing whitespace on save +autocmd BufWritePre *.{js,py,tpl,html} :%s/\s\+$//e + + +" set default font and size +set guifont=Operator\ Mono:h16 + + +" CtrlP Config. +set runtimepath^=~/.vim/bundle/ctrlp.vim +" let g:ctrlp_map = '' +let g:ctrlp_cmd = 'CtrlP' + +" Maps CtrlP to leader to future-proof config. +nnoremap p :CtrlP + +" Fuzzy-finds files within cwd. +" nnoremap pf :CtrlP + +" Ignores dirs and files +let g:ctrlp_custom_ignore = { + \ 'dir': 'node_modules', + \ 'file': '\v\.(exe|dll|png|jpg|jpeg)$' +\} + diff --git a/configs/setup_configs.sh b/configs/setup_configs.sh index 717625934..c0673c0a0 100755 --- a/configs/setup_configs.sh +++ b/configs/setup_configs.sh @@ -4,11 +4,17 @@ pc_settings_path="$HOME/pc_settings" -config_files=( ".zsh_profile" ".tmux.conf" ".ctags" ) +config_files=( \ + ".zsh_profile" \ + ".tmux.conf" \ + ".ctags" \ + ".vimrc" \ +) -for i in {1..3}; do +for i in {0..3}; do cf="${config_files[i]}" + echo "\"$cf\": " if [ -f "$HOME/$cf" ] && [ ! -L "$HOME/$cf" ]; then echo -n "Backing up $cf ... " && \ mv "$HOME/$cf" "$HOME/$cf.bak" && \ @@ -17,14 +23,15 @@ for i in {1..3}; do if [ -L "$HOME/$cf" ]; then if [ $(readlink "$HOME/$cf") = "$pc_settings_path/configs/$cf" ]; then - echo "\"$cf\" is already properly symlinked to \"$pc_settings_path/configs\"." + echo "Already properly symlinked to \"$pc_settings_path/configs\"." else - echo "\"$cf\" is symlinked but not to the proper location." + echo "Already symlinked but NOT to the proper location. Aborting..." fi else echo -n "Symlinking to $pc_settings_path/configs/$cf ... " && \ ln -s "$pc_settings_path/configs/$cf" "$HOME/$cf" && \ echo "Done." fi + echo "" done From ccb74054beedeecd7ecade402f42ef3b3215e47d Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 10 Nov 2016 14:49:13 -0500 Subject: [PATCH 16/21] Adds tmux themes; remaps binding; and more... --- configs/.tmux.conf | 2 ++ configs/.vimrc | 7 +++++++ configs/.zsh_profile | 2 +- configs/setup_configs.sh | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/configs/.tmux.conf b/configs/.tmux.conf index 00e9b750b..e3178acbf 100644 --- a/configs/.tmux.conf +++ b/configs/.tmux.conf @@ -1,5 +1,7 @@ set -g default-terminal "screen-256color" +source-file "${HOME}/makersquare/tmux-themepack/powerline/block/green.tmuxtheme" + bind-key -r -T prefix k select-pane -U bind-key -r -T prefix j select-pane -D diff --git a/configs/.vimrc b/configs/.vimrc index 151391950..57323e8dd 100644 --- a/configs/.vimrc +++ b/configs/.vimrc @@ -340,9 +340,16 @@ nnoremap v7 :resize 35 nnoremap v8 :resize 40 +" NERDTree settings +" Show hidden files by default. (Toggle with capital 'i') +let NERDTreeShowHidden=1 + " View Directory tree with ctrl + \ nnoremap :NERDTreeToggle +" View open buffer location in tree. +nnoremap :NERDTreeFind + " BOL and EOL nnoremap H ^ diff --git a/configs/.zsh_profile b/configs/.zsh_profile index 89eb0b738..f80664afc 100644 --- a/configs/.zsh_profile +++ b/configs/.zsh_profile @@ -24,7 +24,7 @@ source $HOME/pc_settings/scripts/setup_keybindings.sh # BEGIN: bindkeys bindkey "^R" history-incremental-search-backward -bindkey -M viins 'jj' vi-cmd-mode +bindkey -M viins 'jk' vi-cmd-mode # END: bindkeys # export docker env variables diff --git a/configs/setup_configs.sh b/configs/setup_configs.sh index c0673c0a0..02d863277 100755 --- a/configs/setup_configs.sh +++ b/configs/setup_configs.sh @@ -15,6 +15,7 @@ config_files=( \ for i in {0..3}; do cf="${config_files[i]}" echo "\"$cf\": " + if [ -f "$HOME/$cf" ] && [ ! -L "$HOME/$cf" ]; then echo -n "Backing up $cf ... " && \ mv "$HOME/$cf" "$HOME/$cf.bak" && \ From 662c668c486d257c8d97ff839bd5c63f337d1f85 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 10 Nov 2016 16:21:54 -0500 Subject: [PATCH 17/21] Changes default-terminal value according to tmux FAQ --- configs/.tmux.conf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configs/.tmux.conf b/configs/.tmux.conf index e3178acbf..59568dfcb 100644 --- a/configs/.tmux.conf +++ b/configs/.tmux.conf @@ -1,5 +1,3 @@ -set -g default-terminal "screen-256color" - source-file "${HOME}/makersquare/tmux-themepack/powerline/block/green.tmuxtheme" @@ -19,5 +17,5 @@ bind % split-window -c "#{pane_current_path}" bind '"' split-window -h -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}" -set -g default-terminal "screen-256color-italic" +set -g default-terminal "tmux" From 62cabc2e996bd3286fde9c0aa981ad96456c550a Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 10 Nov 2016 17:57:12 -0500 Subject: [PATCH 18/21] Changes tmux prefix and updates vimrc --- configs/.tmux.conf | 4 ++++ configs/.vimrc | 31 ++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/configs/.tmux.conf b/configs/.tmux.conf index 59568dfcb..904c95892 100644 --- a/configs/.tmux.conf +++ b/configs/.tmux.conf @@ -1,5 +1,9 @@ source-file "${HOME}/makersquare/tmux-themepack/powerline/block/green.tmuxtheme" +unbind C-b +set -g prefix C-a +bind C-a send-prefix + bind-key -r -T prefix k select-pane -U bind-key -r -T prefix j select-pane -D diff --git a/configs/.vimrc b/configs/.vimrc index 57323e8dd..59f5e963c 100644 --- a/configs/.vimrc +++ b/configs/.vimrc @@ -75,6 +75,35 @@ set wildmenu set showcmd +" Code folding +set foldmethod=indent +set foldnestmax=10 +set nofoldenable +set foldlevel=4 + +" Opens all folds within the buffer +nnoremap ZZ zR + +" Closes all folds within the buffer +nnoremap zz zM + +" Opens all folds beneath the cursor +" NOTE: j is the character to go down +nnoremap zJ zO + +" Opens single fold beneath the cursor +" NOTE: j is the character to go down +nnoremap zj zo + +" Opens single fold beneath the cursor +" NOTE: k is the character to go down +nnoremap zK zC + +" Opens single fold beneath the cursor +" NOTE: k is the character to go down +nnoremap zk zc + + " Changes to character. let mapleader = " " @@ -100,7 +129,6 @@ set backspace=indent,eol,start " Javascript specific variables let g:javascript_plugin_jsdoc = 1 -" set foldmethod=syntax " GlobalListchars set list @@ -172,6 +200,7 @@ nnoremap bq :bp bd # " make Y do what is intuitive given: " D: deletes until EOL " C: changes until EOL +" Y: (should) yank until EOL nnoremap Y y$ From f4f6a794811c98f657e853167b16171dc257f8d0 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 11 Nov 2016 15:20:00 -0500 Subject: [PATCH 19/21] Updates brew packages and supports Elm syntax in Vim --- brew_packages.txt | 58 +++++++++++++++++++++++++++++++++++++++++++++++ configs/.vimrc | 3 +++ 2 files changed, 61 insertions(+) diff --git a/brew_packages.txt b/brew_packages.txt index e9c365d70..1aa0f2ea8 100644 --- a/brew_packages.txt +++ b/brew_packages.txt @@ -1,26 +1,84 @@ +ack +ansifilter +arpack bash-completion bind chromedriver +cmake cmatrix coreutils cowsay +ctags +elm +epstool +fftw +fltk +fontconfig +freetype +gcc +gd gdbm gettext +ghostscript +gl2ps +glpk +gmp +gnu-sed +gnupg +gnuplot +graphicsmagick +hdf5 +hping +htop httpie +imagemagick +isl +jpeg jq json-c +libevent +libmpc +libpng libstfl +libtiff +libtool +little-cms2 +lua +metis +mpfr +nethogs newsbeuter +nmap +octave oniguruma openssl +pcre +phantomjs pidof +pkg-config +plotutils +pstoedit pup python +python3 +qhull +qrupdate readline recode shc sqlite +suite-sparse +szip +tbb +texinfo +the_silver_searcher +tig +tmux +transfig tree +veclibfort +vim +webp wget xz zsh-syntax-highlighting diff --git a/configs/.vimrc b/configs/.vimrc index 59f5e963c..55f73e571 100644 --- a/configs/.vimrc +++ b/configs/.vimrc @@ -30,6 +30,9 @@ Plugin 'pangloss/vim-javascript' Plugin 'scrooloose/nerdtree' Plugin 'scrooloose/syntastic' +" Syntax Highlighting Support +Plugin 'lambdatoast/elm.vim' + " Themes Plugin 'sickill/vim-monokai' Plugin 'altercation/vim-colors-solarized' From a96c00a36c090f7b23c96861d683977674bc369d Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 14 Nov 2016 18:02:42 -0500 Subject: [PATCH 20/21] Supports less pre-save trailing whitespace trim --- configs/.vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/.vimrc b/configs/.vimrc index 55f73e571..fc5b31859 100644 --- a/configs/.vimrc +++ b/configs/.vimrc @@ -391,7 +391,7 @@ vnoremap L $ " trim trailing whitespace on save -autocmd BufWritePre *.{js,py,tpl,html} :%s/\s\+$//e +autocmd BufWritePre *.{js,py,tpl,less,html} :%s/\s\+$//e " set default font and size From c5a96b49b7a12b52cf9bfdeb4663c6272e093adc Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 16 Nov 2016 15:12:22 -0500 Subject: [PATCH 21/21] Adds relative number settings for line numbers --- configs/.vimrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configs/.vimrc b/configs/.vimrc index fc5b31859..b5bb7241c 100644 --- a/configs/.vimrc +++ b/configs/.vimrc @@ -84,6 +84,11 @@ set foldnestmax=10 set nofoldenable set foldlevel=4 + +" Use relative line numbers +set relativenumber + + " Opens all folds within the buffer nnoremap ZZ zR @@ -361,6 +366,7 @@ nnoremap 8 :vertical resize 80 nnoremap 9 :vertical resize 90 nnoremap 0 :vertical resize 100 + " Increases the height of a horizontal split. nnoremap v1 :resize 5 nnoremap v2 :resize 10