-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvscode-init.vim
41 lines (38 loc) · 1.35 KB
/
vscode-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
function! s:sendSelection()
let visualmode = visualmode()
let startLine = line("v")
let endLine = line(".")
call VSCodeNotifyRange("fsi.SendSelection", startLine, endLine, 1)
endfunction
if exists("g:vscode")
let g:home=expand('<sfile>:p:h')."/"
echom "home: ". g:home
if empty(glob(g:home . 'autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
call plug#begin(g:home.'bundle')
Plug 'tpope/vim-surround'
Plug 'wellle/targets.vim'
Plug 'sheerun/vim-polyglot'
call plug#end()
echom "loaded plugins"
set ignorecase
set clipboard+=unnamedplus
let mapleader=" "
nnoremap <leader>r <Cmd>:Tabfind<CR>
nnoremap <leader>w <Cmd>:Write<CR>
nnoremap <leader>t <Cmd>call VSCodeNotify('workbench.action.showAllSymbols')<CR>
nnoremap <leader>[ <Cmd>call VSCodeNotify('editor.action.marker.next')<CR>
nnoremap <leader>] <Cmd>call VSCodeNotify('editor.action.marker.prev')<CR>
nnoremap <leader>P "0P
vnoremap <leader>p "0p
nnoremap <leader>a :b#<cr>
nnoremap <leader>d <Cmd>call VSCodeNotify('workbench.action.closeActiveEditor')<cr>
xnoremap <leader><CR> <Cmd>call <SID>sendSelection()<CR>
xmap gc <Plug>VSCodeCommentary
nmap gc <Plug>VSCodeCommentary
omap gc <Plug>VSCodeCommentary
nmap gcc <Plug>VSCodeCommentaryLine
echom "loaded mappings"
endif