Merge branch 'master' of github.com:aarongut/dotfiles
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
||||
let &packpath = &runtimepath
|
||||
source ~/.vimrc
|
||||
|
||||
set runtimepath+=~/.config/nvim/
|
||||
|
||||
lua require('lsp')
|
||||
|
||||
52
.config/nvim/lua/lsp.lua
Normal file
52
.config/nvim/lua/lsp.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
-- Mappings.
|
||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||
local opts = { noremap=true, silent=true }
|
||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local bufopts = { noremap=true, silent=true, buffer=bufnr }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
|
||||
end
|
||||
|
||||
local lsp_flags = {
|
||||
}
|
||||
require('lspconfig')['pyright'].setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
}
|
||||
require('lspconfig')['tsserver'].setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
}
|
||||
require('lspconfig')['rust_analyzer'].setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
-- Server-specific settings...
|
||||
settings = {
|
||||
["rust-analyzer"] = {}
|
||||
}
|
||||
}
|
||||
26
.vimrc
26
.vimrc
@@ -9,10 +9,8 @@ Plug 'junegunn/fzf', {'do': { -> fzf#install() }}
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Plug 'scrooloose/nerdtree'
|
||||
Plug 'Xuyuanp/nerdtree-git-plugin'
|
||||
Plug 'git@github.com:ervandew/supertab.git'
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
" Plug 'altercation/vim-colors-solarized'
|
||||
Plug 'arcticicestudio/nord-vim'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'jez/vim-ispc'
|
||||
@@ -24,18 +22,12 @@ if has('nvim')
|
||||
" Typescript
|
||||
Plug 'HerringtonDarkholme/yats.vim'
|
||||
Plug 'jelera/vim-javascript-syntax'
|
||||
Plug 'mhartington/nvim-typescript', {'do': './install.sh'}
|
||||
Plug 'Shougo/deoplete.nvim'
|
||||
Plug 'Shougo/denite.nvim'
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
|
||||
let g:deoplete#enable_at_startup = 1
|
||||
|
||||
autocmd FileType typescript nnoremap <buffer> <C-]> :TSDef<CR>
|
||||
autocmd FileType typescript nnoremap <buffer> <Leader>t :TSType<CR>
|
||||
autocmd FileType typescript nnoremap <buffer> <Leader>d :TSDoc<CR>
|
||||
"let g:deoplete#enable_at_startup = 1
|
||||
else
|
||||
Plug 'Quramy/tsuquyomi'
|
||||
Plug 'leafgarland/typescript-vim'
|
||||
" Vim-only plugins here
|
||||
endif
|
||||
|
||||
call plug#end()
|
||||
@@ -115,18 +107,6 @@ nmap <Leader>a :Ack!<Space>
|
||||
nmap <Leader>c :cclose<CR>
|
||||
nmap <Leader>C :copen<CR>
|
||||
|
||||
" supertab
|
||||
let g:SuperTabDefaultCompletionType = "<c-x><c-o>"
|
||||
|
||||
" Scala
|
||||
let g:lsc_enable_autocomplete = v:false
|
||||
let g:lsc_server_commands = {
|
||||
\ 'scala': 'metals-vim'
|
||||
\}
|
||||
let g:lsc_auto_map = {
|
||||
\ 'GoToDefinition': 'gd',
|
||||
\}
|
||||
|
||||
" set light mode?
|
||||
if !empty($LC_LIGHT_BG)
|
||||
colorscheme default
|
||||
|
||||
Reference in New Issue
Block a user