This repository was archived by the owner on May 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patholdvimrc
More file actions
154 lines (143 loc) · 4.51 KB
/
Copy patholdvimrc
File metadata and controls
154 lines (143 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
" Install Pathogen
" mkdir autoload bundle
" curl -LSso autoload/pathogen.vim https://tpo.pe/pathogen.vim
"
" Rrun the following in bundle
" git clone http://github.com/junegunn/vim-easy-align
" git clone http://github.com/xolox/vim-misc
" git clone http://github.com/xolox/vim-session
" git clone http://github.com/scrooloose/nerdtree
" git clone http://github.com/scrooloose/nerdcommenter
" git clone http://github.com/jistr/vim-nerdtree-tabs
" git clone http://github.com/tpope/vim-fugitive
" git clone http://github.com/bling/vim-airline
" git clone http://github.com/mbbill/undotree
" git clone http://github.com/mattn/emmet-vim
" git clone http://github.com/Ntpeters/vim-better-whitespace
" git clone https://github.com/kien/ctrlp.vim
" https://github.com/junegunn/vim-easy-align
" TODO: create bash and batch/powershell commands to install and update
" plugins
let mapleader = ","
let maplocalleader = "\\"
execute pathogen#infect()
syntax on
filetype plugin indent on
" Global Variables
" Turn on highlighted search. Use :noh to clear highlighting
set hlsearch
" Turn on incremental search
set incsearch
" ignore case in search...
set ignorecase
" ... except when using upper case
set smartcase
" Allow buffers to be hidden without saving
set hidden
" Line number on current line and relative number elsewhare
set number relativenumber
" Personal Keybinds
" Easy navigation between open windows
nnoremap <leader>h <C-W><C-H>
nnoremap <leader>l <C-W><C-L>
nnoremap <leader>j <C-W><C-J>
nnoremap <leader>k <C-W><C-K>
" Quicker scrolling throw a page
nnoremap <c-j> 10j
nnoremap <c-k> 10k
xnoremap <c-j> 10j
xnoremap <c-k> 10k
" Quickly exit insert mode
inoremap jk <esc>
inoremap <esc> <nop>
" Quickly clear highlighting
nnoremap <leader>q :nohlsearch<cr>
" Re-highlight section after indent
vnoremap > >gv
vnoremap < <gv
" Quicky navigate buffers
nnoremap <c-n> :bnext<cr>
nnoremap <c-p> :bprev<cr>
nnoremap <leader>b :b#<cr>
" Quickly edit and load vimrc
nnoremap <leader>ev :split $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
" NERDtree tabs keymaps
nmap <leader>t <plug>NERDTreeTabsToggle<CR>
nmap <leader>f <plug>NERDTreeTabsFind<CR>
" easy-align keymaps
vmap <enter> <plug>(EasyAlign)
nmap ga <plug>(EasyAlign)
" CtrlP keymaps
nnoremap ; :CtrlPBuffer<cr>
" CtrlP Settings
let g:ctrlp_map = '<leader>s'
let g:ctrlp_match_window_bottom = 0
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_custom_ignore = {
\'dir': '\v[\/](node_modules|\.svn)$'
\}
" Close currently selected buffer in CtrlP
let g:ctrlp_buffer_func = {'enter': 'MyCtrlPMappings' }
func! MyCtrlPMappings()
nnoremap <buffer> <silent> <c-@> :call <sid>DeleteBuffer()<cr>
endfunc
func! s:DeleteBuffer()
let line = getline('.')
let bufid = line =~ '\[\d\+\*No Name\]$' ? str2nr(matchstr(line, '\d\+'))
\ : fnamemodify(line[2:], ':p')
exec "bd" bufid
exec "norm \<F5>"
endfunc
" Unite keymaps
"nnoremap <leader>uu :<c-u>Unite -buffer-name=menu<cr>
"nnoremap <leader>uf :<c-u>Unite -buffer-name=files file<cr>
"nnoremap <leader>uy :<c-u>Unite -buffer-name=yanks history/yank<cr>
"nnoremap <leader>ub :<c-u>Unite -buffer-name=buffers buffer<cr>
"" Unite settings
"call unite#filters#matcher_default#use(['matcher_fuzzy'])
"let g:unite_source_history_yank_enable = 1
" Undotree keymaps
nnoremap <f5> :UndotreeToggle<CR>
" Tab Settings
set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab
" gui settings
if has('gui_running')
let g:nerdtree_tabs_open_on_gui_startup = 0
" set initial window size
set lines=40 columns=150
" hide menu (m) toolbar (T) scrollbar (r) lefthand scrollbar when split (L)
set go-=m go-=T go-=r go-=L
if has('gui_win32')
set encoding=utf-8
let g:airline_power_fonts = 1
"set gfn=Fira_Mono_Regular_for_Powerline:h10
set gfn=Powerline_Consolas:h10
" set backup and swap directories
set backupdir=~/vimfiles/tmp/backup//
set dir=~/vimfiles/tmp/swap//
" Unite settings
let g:unite_data_directory = '~/vimfiles/unite'
endif
"colorscheme wombat
else
let g:nerdtree_tabs_open_on_console_startup = 0
" set backup and swap directories - non gui so i'm probably on osx/linux
set backupdir=~/.vim/tmp/backup//
set dir=~/.vim/tmp/swap//
" Unite settings
let g:unite_data_directory = '~/.vim/unite'
" airline settings
let g:airline_powerline_fonts = 1
"colorscheme wombat256
set mouse=a
endif
colorscheme wombat256
" airline settings
let g:airline_exclude_preview = 1
let g:airline#extensions#tabline#enabled = 1
" for some reason this allows for airline to show up even when only 1 window
" is open
set laststatus=2
" turn off auto load session
:let g:session_autoload = 'no'