-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
165 lines (134 loc) · 3.69 KB
/
init.vim
File metadata and controls
165 lines (134 loc) · 3.69 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set relativenumber
set nu
set nohlsearch
set magic
set guicursor=
set noerrorbells
set hidden
set nowrap
set smartcase
set ignorecase
set nobackup
set noswapfile
set nobackup
set undodir=~/.config/nvim/undodir
set undofile
set incsearch
set scrolloff=8
set signcolumn=yes
set colorcolumn=80
set showmatch
set mat=3
" more space for messages
set cmdheight=2
set updatetime=50
" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
let mapleader = " "
let g:mapleader = " "
" toggle colorcolumn
fun! ToggleCC()
if &cc == ''
set cc=80
else
set cc=
endif
endfun
nnoremap <F2> :call ToggleCC()<CR>
" swap semicolon and colon in normal mode
nnoremap ; :
nnoremap : ;
"underline
nnoremap <F4> yypVr-j
inoremap <F4> <esc>yypVr-ji
nnoremap <Leader><CR> :so ~/.config/nvim/init.vim<CR>
nnoremap <Tab> :bnext<CR>
nnoremap <S-Tab> :bprevious<CR>
" surround word in quotes
nnoremap <leader>" viw<esc>a"<esc>bi"<esc>lel
nnoremap <leader>' viw<esc>a'<esc>bi'<esc>lel
" delete to void
"vnoremap <leader>p "_dP
" copy to system clipbard
vnoremap <leader>y "+y
nnoremap <leader>Y gg"+yG
vnoremap <leader>d "_d
" make :Wrap wrap lines without splitting word
command! -nargs=* Wrap set wrap linebreak nolist
" move around a wrapped line
vmap <D-j> gj
vmap <D-k> gk
vmap <D-4> g$
vmap <D-6> g^
vmap <D-0> g^
nmap <D-j> gj
nmap <D-k> gk
nmap <D-4> g$
nmap <D-6> g^
nmap <D-0> g^
" " Panel switching
map <leader>h :wincmd h<CR>
map <leader>j :wincmd j<CR>
map <leader>k :wincmd k<CR>
map <leader>l :wincmd l<CR>
" " Split panel
nnoremap <leader>v <C-w>v
nnoremap <leader>s <C-w>s
" vipsql mappings
" Starts an async psql job, prompting for the psql arguments.
" Also opens a scratch buffer where output from psql is directed.
noremap <leader>po :VipsqlOpenSession<CR>
" Terminates psql (happens automatically if the output buffer is closed).
noremap <silent> <leader>pk :VipsqlCloseSession<CR>
" In normal-mode, prompts for input to psql directly.
nnoremap <leader>ps :VipsqlShell<CR>
" In visual-mode, sends the selected text to psql.
vnoremap <leader>ps :VipsqlSendSelection<CR>
" Sends the selected _range_ to psql.
noremap <leader>pr :VipsqlSendRange<CR>
" Sends the current line to psql.
noremap <leader>pl :VipsqlSendCurrentLine<CR>
" Sends the entire current buffer to psql.
noremap <leader>pb :VipsqlSendBuffer<CR>
" Sends `SIGINT` (C-c) to the psql process.
noremap <leader>pc :VipsqlSendInterrupt<CR>
call plug#begin('~/.config/nvim/plugged')
Plug 'rizzatti/dash.vim'
Plug 'neovim/nvim-lspconfig'
Plug 'christoomey/vim-tmux-runner'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
" Plug 'puremourning/vimspector'
Plug 'mbbill/undotree'
Plug 'szw/vim-maximizer'
" Plug 'nvim-telescope/telescope.nvim'
Plug 'preservim/nerdtree'
Plug 'Raimondi/delimitMate'
Plug 'itchyny/lightline.vim'
Plug 'jalvesaq/Nvim-R', {'branch': 'stable'}
Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'
Plug 'gaalcaras/ncm-R'
Plug 'martingms/vipsql'
Plug 'lifepillar/pgsql.vim'
Plug 'mzarnitsa/psql'
call plug#end()
let g:sql_type_default = 'pgsql'
"let b:sql_type_override='pgsql' | set ft=sql
"nvim_lsp:python:setup{...}
let g:LanguageClient_serverCommands = {
\ 'r': ['R', '--slave', '-e', 'languageserver::run()'],
\ }
fun! TrimWhiteSpace()
let l:save = winsaveview()
keeppatterns %s/\s\+$//e
call winrestview(l:save)
endfun
augroup FIETE
autocmd!
autocmd BufWritePre * :call TrimWhiteSpace()
augroup END