-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
134 lines (113 loc) · 3.23 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
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
" Disable the default Vim startup message.
" set shortmess+=I
set encoding=UTF-8
" Cursor position
set ruler
set cursorline
" Show line numbers.
set number
set relativenumber
set expandtab
set tabstop=4 softtabstop=4
set shiftwidth=4
set smartindent
" Always show the status line at the bottom, even if you only have one window open.
set laststatus=2
set backspace=indent,eol,start
set hidden
" This setting makes search case-insensitive when all characters in the string
" being searched are lowercase. However, the search becomes case-sensitive if
" it contains any capital letters. This makes searching more convenient.
set ignorecase
set smartcase
" Enable searching as you type, rather than waiting till you press enter.
set incsearch
set nohlsearch
set hidden
set noerrorbells visualbell t_vb=
set noswapfile
set nobackup
set undodir=~/.vim/undodir
set undofile
set scrolloff=8
set signcolumn=yes
" Splitting
set splitbelow splitright
" 'Q' in normal mode enters Ex mode. You almost never want this.
nmap Q <Nop>
" Enable mouse support. You should avoid relying on this too much, but it can
" sometimes be convenient.
set mouse+=a
set clipboard=unnamedplus "copy and paste to other
" Leader key
let mapleader=","
" set working directory to current file
autocmd BufEnter * lcd %:p:h
" Alternate way to save
nnoremap <C-s> :w<CR>
map <leader>q :q<CR>
nnoremap <C-c> <Esc>
" Open terminal at current file directory
map <F6> :let $VIM_DIR=expand('%:p:h')<CR>:terminal<CR>cd $VIM_DIR<CR>
call plug#begin('~/.local/share/nvim/site/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'sheerun/vim-polyglot'
" Plug 'jiangmiao/auto-pairs'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'christoomey/vim-tmux-navigator'
"NERDTree
Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'scrooloose/nerdcommenter'
"One-Dark
Plug 'joshdick/onedark.vim'
call plug#end()
set nocompatible
" Turn on syntax highlighting.
syntax on
set showmatch
colorscheme onedark
" NERDTree configs
" automatically starts NERDTree
autocmd VimEnter * NERDTree | wincmd p
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
nmap <C-n> :NERDTreeToggle<CR>
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" Find current directory
map <leader>f :NERDTreeFind<CR>
" Window Navigation
" nnoremap <C-h> <C-w>h
" nnoremap <C-j> <C-w>j
" nnoremap <C-k> <C-w>k
" nnoremap <C-l> <C-w>l
let g:NERDTreeGitStatusWithFlags = 1
" Visual Setting
"""""""""""""""""
let g:goyo_width=85
let g:limelight_conceal_ctermfg = 'gray'
let g:limelight_conceal_ctermfg = 240
let g:limelight_conceal_guifg = 'DarkGray'
let g:limelight_conceal_guifg = '#777777'
let g:limelight_bop = '%.*$'
"' let g: limelight_eop = '\n'
let g:limelight_paragraph_span = 0
"COC
command! -nargs=0 Prettier :CocComnnad prettier.formatFile
let g:coc_global_extensions = [
\ 'coc-snippets',
\ 'coc-pairs',
\ 'coc-tsserver',
\ 'coc-eslint',
\ 'coc-prettier',
\ 'coc-json',
\ ]
" remaps for vscode functions
nmap <F2> <Plug>(coc-rename)
nmap <silent> gd <Plug>(coc-definition)
inoremap <silent><expr> <c-space> coc#refresh()