-
Notifications
You must be signed in to change notification settings - Fork 2
/
neovim.vim
102 lines (79 loc) · 2.28 KB
/
neovim.vim
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
filetype plugin indent on
set nowrap
set textwidth=100
set hidden
command! -bang -nargs=* FindInFiles call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --glob "!.git/*" --follow --color "always" '.shellescape(<q-args>), 1, <bang>0)
" Tab and editor settings
set expandtab
" Searching
set ignorecase
set smartcase
" Visual stuff
set showmatch " Show matching brackets
set number " always show linenumbers
" I like to spell correctly
set spelllang=en_us
" show whitespace
set listchars=space:·,tab:→\
set list
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
if filereadable(expand("~/.vimrc_background"))
if !$KONSOLE
let base16colorspace=256
endif
source ~/.vimrc_background
endif
endif
" --------------
" statusline
" --------------
set statusline=
set statusline+=%#CursorColumn#
set statusline+=🌵\ %{FugitiveHead(8)}
set statusline+=%#Title#
set statusline+=\ 📝\ %f
set statusline+=%m
set statusline+=%=
set statusline+=%#CursorColumn#
set statusline+=📣\ %y
set statusline+=\ %{&fileencoding?&fileencoding:&encoding}
set statusline+=[%{&fileformat}\]
set statusline+=\ 📏\ %l(%L)
" ----------------
" general settings
" ----------------
let mapleader = ","
set mousehide " Hide mouse after chars typed
" -------------
" key mappings
" -------------
" do not use arrow keys
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
" fzf
nnoremap <c-p> :Files<cr>
nnoremap <c-g> :GFiles<cr>
" diff shortcuts for fugitive
nnoremap <leader>2 :diffget //2<CR>
nnoremap <leader>3 :diffget //3<CR>
" global mappings
nmap <leader>l :set list!<CR>
" Use space to get into command mode
noremap <Space> :
" search in files
nnoremap <leader>f :FindInFiles <c-r><c-w><cr>
nnoremap <leader>F :FindInFiles<space>
" Use <leader>q to turn off highlighting
nnoremap <leader>q :noh<CR>
" Use <leader>k to kill buffer but not split
nnoremap <leader>k :bp\|bd #<CR>