forked from nevercodealone/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
99 lines (79 loc) · 2.46 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
" Initialize plugin manager
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
" Declare the list of plugins.
Plug 'preservim/nerdtree'
Plug 'pangloss/vim-javascript'
Plug 'leafgarland/typescript-vim'
Plug 'lifepillar/vim-solarized8'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-fugitive'
Plug 'phpactor/phpactor', {'for': 'php', 'do': ':PhpactorInstall'}
" End of plugin declaration
call plug#end()
" General Vim settings
set tabstop=4
set shiftwidth=4
set expandtab
syntax on
set termguicolors
set background=dark
colorscheme solarized8
set number
set rnu
set mouse=a
" use +y on Mac
set clipboard=unnamed
set encoding=utf-8
set spell
set spelllang=en
set autoindent
set smartindent
" NERDTree settings (omitted for brevity)
let NERDTreeShowHidden=1
" coc.nvim settings
set encoding=utf-8
set nobackup
set nowritebackup
set updatetime=300
set signcolumn=yes
" Leader
let mapleader = ","
" Cursor shape settings
let &t_SI = "\e[5 q" " Cursor shape in Insert mode
let &t_SR = "\e[4 q" " Cursor shape in Replace mode
let &t_EI = "\e[2 q" " Cursor shape in Normal mode
" Toggle cursor line on entering and leaving insert mode
autocmd InsertEnter,InsertLeave * set cul!
" Save
nnoremap <C-s> :w<CR>
" Use tab for trigger completion with characters ahead and navigate
inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
" Use <CR> to confirm completion, `<C-g>u` means break undo chain at current position.
inoremap <expr> <CR> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Fuzzy finder
nnoremap ff :Files<CR>
nnoremap <leader>w :w!<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
" coc.nvim key mappings
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
nmap <leader>rn <Plug>(coc-rename)
nnoremap <silent> K :call ShowDocumentation()<CR>
autocmd CursorHold * silent call CocActionAsync('highlight')
" Other coc.nvim settings and mappings (omitted for brevity)
" Function to show documentation
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
" End of file