-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.vim
81 lines (60 loc) · 1.78 KB
/
init.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
" Neovim configuration file
" Don't show intro
set shortmess+=I
" Enable syntax highlighting
syntax on
" Stop mouse
set mouse=
" Set the tab width to 4 spaces
set tabstop=4
set shiftwidth=4
set expandtab
" Enable line numbers
set number
" Enable searching with '/' or '?'
set hlsearch
" Ignore case when searching, unless the search pattern contains uppercase characters
set ignorecase
set smartcase
" Enable autoindent
set autoindent
" Enable filetype detection and plugins
filetype plugin indent on
" Set the leader key to ','
let mapleader = ","
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-h> <C-w>h
nmap <C-l> <C-w>l
call plug#begin()
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'neoclide/coc.nvim'
Plug 'sheerun/vim-polyglot'
Plug 'christoomey/vim-tmux-navigator'
Plug 'justinmk/vim-sneak'
call plug#end()
" Map escape to exit terminal mode
:tnoremap <ESC> <C-\><C-n>
" toggle line numbering
nnoremap <leader>n :set number<CR>
nnoremap <leader>N :set nonumber<CR>
" ignore some directories with CTRL-P
let g:ctrlp_custom_ignore = {'dir': '\v[\/](target|results|build|node_modules)$'}
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" GoTo code navigation
nmap <silent> gd <Plug>(coc-definition)
" Taking some coc.nvim setting suggestions
" Having longer updatetime (default is 4000 ms = 4s) leads to noticeable
" delays and poor user experience
set updatetime=300
" Symbol renaming
nmap <leader>rn <Plug>(coc-rename)
" no word wrap
set nowrap
"Prevent automatic insertation of comments on new lines
set formatoptions-=cro