Skip to content

Instantly share code, notes, and snippets.

@demelev
Created Apr 26, 2017
Embed
What would you like to do?
SpaceVim config
" setting layers, load 'lang#java' layer.
call SpaceVim#layers#load('lang#cs')
"call SpaceVim#layers#load('incsearch')
"let g:spacevim_enable_ycm = 1
let g:spacevim_windows_leader = '<leader>w'
let g:spacevim_enable_vimfiler_welcome = 1
" add custom plugins.
let g:spacevim_custom_plugins = [
\ ['plasticboy/vim-markdown', {'on_ft' : 'markdown'}],
\ ['wsdjeg/GitHub.vim'],
\ ['ryanoasis/vim-devicons'],
\ ['ludovicchabant/vim-ctrlp-autoignore'],
\ ['eugen0329/vim-esearch'],
\ ['roxma/nvim-completion-manager', { 'on_ft': 'rust'}],
\ ['rust-lang/rust.vim', { 'on_ft': 'rust' }],
\ ['autozimu/LanguageClient-neovim'],
\ ['wellle/targets.vim'],
\ ['kana/vim-textobj-user'],
\ ['tommcdo/vim-exchange'],
\ ['wsdjeg/ctrlp-unity3d-docs', { 'on_cmd' : 'CtrlPUnity3DDocs'}]
\]
let g:ctrlp_extensions = ['autoignore']
let NERDTreeIgnore = ['\.meta$']
"let g:spacevim_disabled_plugins = ['Yggdroot/indentLine']
"let g:spacevim_unite_leader = "<leader>u"
let g:spacevim_realtime_leader_guide = 1
let g:spacevim_enable_cursorline = 1
let g:spacevim_snippet_engine = 'ultisnips'
""
" The default file manager of SpaceVim.
let g:spacevim_filemanager = 'nerdtree'
" custom mappings:
nnoremap - :VimFilerBufferDir<cr>
nnoremap <space>w :w<cr>
nnoremap <space>q :q<cr>
map <A-b> :CtrlPBuffer<cr>
map <A-m> :CtrlPBufTag<cr>
" Buffers
" {{{ Space mappings ==
" Better windows navigation
nmap <space>H <c-w>H
nmap <space>L <c-w>L
nmap <space>J <c-w>J
nmap <space>K <c-w>K
nmap <space>h <c-w>h
nmap <space>l <c-w>l
nmap <space>j <c-w>j
nmap <space>k <c-w>k
" Openbrowser maps
"nmap <leader>qu <Plug>(openbrowser-search)
nmap <space>sg :OpenBrowserSearch -google <c-r>=expand("<cword>")<cr><cr>
nmap <space>su :OpenBrowserSearch -unity3d <c-r>=expand("<cword>")<cr><cr>
nmap <space>sr :OpenBrowserSearch -rust <c-r><c-w><cr>
nmap <space>ag :OpenBrowserSearch -google
nmap <space>au :OpenBrowserSearch -unity3d
nmap <space>ar :OpenBrowserSearch -rust
nmap <silent> <space> <NOP>
nmap <space><space> :
" When entering command, press %% to quickly insert current path
cmap %% <C-R>=expand('%:h').'/'<cr>
" Tab in normal mode is useless - use it to %
nnoremap <Tab> %
vnoremap <Tab> %
" == Ack ===========
nnoremap <leader>a :Ack<space>
" == Fugitive =======
noremap <leader>gd :Gdiff<CR>
noremap <leader>gc :Gcommit<CR>
noremap <leader>gs :Gstatus<CR>
noremap <leader>gw :Gwrite<CR>
noremap <leader>gb :Gblame<CR>
set inccommand=split
autocmd FileType rust LanguageClientStart
let g:LanguageClient_selectionUI = "fzf"
let g:LanguageClient_serverCommands = {
\ 'rust': ['rls'],
\ }
nnoremap <silent> K :call LanguageClient_textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient_textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient_textDocument_rename()<CR>
"nnoremap <silent> <m-m> :call LanguageClient_textDocument_documentSymbol()<CR>
nnoremap <silent> <leader>fu :Denite references<CR>
let g:vimfiler_ignore_pattern = ['^\.git$', '^\.DS_Store$', '\.meta$']
let g:indentLine_enabled = 0
let g:ycm_key_invoke_completion = '<c-tab>'
" {{{ UltiSnips
let g:snips_author = 'Eugene Mihailenco <mihailencoe@gmail.com>'
let g:UltiSnipsEnableSnipMate = 1
"let g:UltiSnipsUsePythonVersion = 2
let g:UltiSnipsEditSplit = 'context'
let g:UltiSnipsExpandTrigger = '<c-l>'
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsSnippetDirectories = ['Ultisnips']
" }}} UltiSnips
" {{{ OmniSharp
let g:Omnisharp_start_server = 1
let g:Omnisharp_stop_server = 1
let g:OmniSharp_host="http://localhost:2000"
"let g:ycm_csharp_server_port = 20001
let g:OmniSharp_timeout = 1
"let g:OmniSharp_server_type = 'v1'
let g:OmniSharp_server_type = 'roslyn'
let g:OmniSharp_want_snippet = 1
let g:OmniSharp_selector_ui = 'ctrlp'
"Set autocomplete function to OmniSharp (if not using YouCompleteMe completion plugin)
autocmd FileType cs setlocal omnifunc=OmniSharp#Complete
" If you prefer the Omni-Completion tip window to close when a selection is
" made, these lines close it on movement in insert mode or when leaving
" insert mode
" autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
" autocmd InsertLeave * if pumvisible() == 0|pclose|endif
" }}} OmniSharp
"Super tab settings - uncomment the next 4 lines
let g:SuperTabDefaultCompletionType = 'context'
let g:SuperTabContextDefaultCompletionType = "<c-x><c-o>"
let g:SuperTabDefaultCompletionTypeDiscovery = ["&omnifunc:<c-x><c-o>","&completefunc:<c-x><c-n>"]
let g:SuperTabClosePreviewOnPopupClose = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment