-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
133 lines (105 loc) · 3.54 KB
/
.vimrc
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
colorscheme ir_black
syntax enable
" Background
set background=dark
" HardTime (delayed h/j/k/l)
" let g:hardtime_default_on = 1
set formatoptions-=cro "disables continuation of comments on new lines
set colorcolumn=100 " vertical column at char 100 on each line
highlight ColorColumn ctermbg=Black
set autoindent " copy current indentation when inserting new line
set path+=** " search down into subfolders & tab completion for all related tasks
set wildmenu " display all matching files when we tab complete
set relativenumber " show relative numbers
set laststatus=2 " lightline fix
set autoindent " enable autoindentation
set tabstop=4 " # of visual spaces per tab
set softtabstop=4 " # of spaces per tab when editing
set shiftwidth=4 " # of spaces to use for autoindent
set expandtab " tabs are spaces
set number " show line numbers
set showcmd " show command in bottom bar
set cursorline " highlight current line
set lazyredraw " redraw only when we need to -> faster macros
set showmatch " highlight matching parens
set incsearch " search as characters are entered
set hlsearch " highlight matches
set wildmenu " visual autocomplete for cmd menu
filetype plugin indent on " activate extension-specific vim settings
" Create the `tags` file (requires ctags) ; ^ = control
" - Use ^] to jump to tag under cursor
" - Use g^] for ambiguous tags
" - Use ^t to jump back up the tag stack
" For a visual list of tags, use taglist
command! MakeTags !ctags -R .
" turn off search highlight
nnoremap <leader><space> :nohlsearch<CR>
set foldenable " enable folding
set foldlevelstart=10 " open most folds til level 10
set foldnestmax=10 " maximum number of nested folds
" space open/closes folds
noremap <space> za
" fold based on indent level
set foldmethod=indent
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" move to beginning/EOL
nnoremap B ^
nnoremap E $
" disable ^ & $
nnoremap ^ <nop>
nnoremap $ <nop>
" disable arrow keys
noremap <Left> <nop>
noremap <Right> <nop>
noremap <Up> <nop>
noremap <Down> <nop>
inoremap <Left> <nop>
inoremap <Right> <nop>
inoremap <Up> <nop>
inoremap <Down> <nop>
" bind jk to esc
inoremap jk <esc>
" create new key
let mapleader=","
" toggle undotree
nnoremap <leader>u :UndotreeToggle<CR>
" nohl remap
nnoremap <leader>/ :nohlsearch<CR>
" change to current directory
nnoremap <leader>cd :cd %:p:h<CR>
" FZF mappings
nnoremap <C-p> :Files<Cr>
" FZF.vim now supports this command out of the box
" so this code is potentially no longer needed.
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --line-number --hidden --ignore-case --no-heading --color=always '.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'up:60%')
\ : fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'right:50%:hidden', '?'),
\ <bang>0)
" Rg mappings
nnoremap <leader>a :Rg<Cr>
"
" Rg mappings
nnoremap <C-f> :Ranger<Cr>
"
" Reload vimrc
nnoremap <leader>sv :source $MYVIMRC<CR>
" Edit virmc
nnoremap <leader>ev :vsp $MYVIMRC<CR>
" activate pathogen
call pathogen#infect()
call pathogen#helptags()
" autocommands
" set comment string for Python
autocmd FileType python setlocal commentstring=#\ %s
" syntactic
"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 = 0