-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc_main
117 lines (93 loc) · 3.01 KB
/
vimrc_main
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
" TODO:
" - copy the name of the current file to the system clipboard
" - link the system clipboard to the vim clipboard properly - so yy puts the
" text on the vim clipboard, and so that command c is pasted into vim with
" pp
" - autoformat on save of the file
" Mapping the leader to the 'gh' combo
:let mapleader = "gh"
set visualbell "no sounds - from dbalatero
set showmode
set number
"turn on syntax highlighting
syntax on
" remap ESC to jj - to allow INSERT -> VISUAL transition to be easier
inoremap jj <esc>
" Turn Off Swap Files
set noswapfile
set nobackup
set nowb
" Tab things - taken from dbalatero; might remove some of these
set autoindent
set smartindent
set smarttab
set shiftwidth=2
set softtabstop=2
set tabstop=2
set expandtab
" Yank to the system clipboard
set clipboard=unnamed
" Remove arrow keys in Insert Mode
inoremap <Down> <Nop>
inoremap <Left> <Nop>
inoremap <Right> <Nop>
inoremap <Up> <Nop>
" Remove arrow keys in Normal Mode
nnoremap <Down> <Nop>
nnoremap <Left> <Nop>
nnoremap <Right> <Nop>
nnoremap <Up> <Nop>
" Remove arrow keys in Visual Mode
vnoremap <Down> <Nop>
vnoremap <Left> <Nop>
vnoremap <Right> <Nop>
vnoremap <Up> <Nop>
" ======== Plugins ========
call plug#begin('~/.local/nvim/plugins')
" Install these with :PlugInstall inside of a nvim instance - you'll need to
" restart nvim, then call PlugInstall, then you should be good
Plug 'mileszs/ack.vim' " like a better grep (specifically for code) in Vim
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'preservim/nerdtree'
Plug 'sainnhe/everforest'
call plug#end()
" colorscheme - adding after Plug has installed these; needs to be after
" plug#end()
colorscheme everforest
set background=dark
" ===== FZF config
" so you don't have to type :Files
noremap <Leader>p :Files<CR>
" ==== Ack config
" so you can search for files easier
" - docs: https://github.com/mileszs/ack.vim
" using ripgrep as the backend for Ack.vim's search - this is _fast_
" compared to grep, ack's backend, or ag (the silver searcher)
let g:ackprg = 'rg --vimgrep'
" autoclose the list of search results after an option is selected
let g:ack_autoclose = 1
" workflow: do Leader - i
noremap <Leader>i :Ack<Space>
" ==== Editing
" making the default splitting to the right, or below
" The default is to the left, which is dumb as hell
set splitright
set splitbelow
" Create window splits easier with just vv or ss
nnoremap <silent> vv <C-w>v
nnoremap <silent> ss <C-w>s
nnoremap ; :
nnoremap <Leader>a :echo "Hello there you memer"<CR>
" this remapping is super nice for all the C-w
" vim makes you do to switch between windows
nnoremap <Leader>w <C-w>
" ======= NVIM Terminal remapping
:tnoremap jj <C-\><C-n>
" After the above remapping, your basic NVIM + terminal workflow looks like:
" - open w/ :te or :terminal
" - exit by running 'exit' in the terminal
" - <Leader>w to nav between windows
" - jj when in terminal mode to switch to vim mode
" - any command that puts you in 'insert' mode to switch from vim mode to i
" or a