Add solargraph

This commit is contained in:
Rawley Fowler 2022-07-17 08:21:22 -06:00 committed by GitHub
parent 86a8e652a0
commit e6ff7fc758
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,10 +3,13 @@ local cmd = vim.api.nvim_command
local au = vim.api.nvim_create_autocmd local au = vim.api.nvim_create_autocmd
local plug = vim.fn['plug#'] local plug = vim.fn['plug#']
-- Plugins
vim.call('plug#begin', '~/.config/nvim/plugged') vim.call('plug#begin', '~/.config/nvim/plugged')
plug('jnurmine/zenburn') plug('jnurmine/zenburn')
plug('ap/vim-css-color') plug('ap/vim-css-color')
plug('ap/vim-buftabline') plug('ap/vim-buftabline')
plug('kana/vim-textobj-user')
plug('whatyouhide/vim-textobj-erb')
plug('dag/vim-fish') plug('dag/vim-fish')
plug('kassio/neoterm') plug('kassio/neoterm')
plug('tpope/vim-dispatch') plug('tpope/vim-dispatch')
@ -51,6 +54,7 @@ set.autoindent = true
set.autowrite = true set.autowrite = true
set.ai = true set.ai = true
set.wildignore = {'*/cache/*', '*/tmp*'} set.wildignore = {'*/cache/*', '*/tmp*'}
-- Keybindings -- Keybindings
function map(mode, lhs, rhs, opts) function map(mode, lhs, rhs, opts)
options = {} options = {}
@ -59,12 +63,15 @@ function map(mode, lhs, rhs, opts)
end end
vim.api.nvim_set_keymap(mode, lhs, rhs, options) vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end end
---- Cycling through buffers ---- Cycling through buffers
map('n', '<C-h>', ':bprev<cr>', { noremap = true }) map('n', '<C-h>', ':bprev<cr>', { noremap = true })
map('n', '<C-l>', ':bnext<cr>', { noremap = true }) map('n', '<C-l>', ':bnext<cr>', { noremap = true })
---- NERDTree ---- NERDTree
map('n', '<S-w>', ':NERDTreeToggle<cr>', { noremap = true }) map('n', '<S-w>', ':NERDTreeToggle<cr>', { noremap = true })
map('n', '<S-q>', ':NERDTreeClose<cr>', { noremap = true }) map('n', '<S-q>', ':NERDTreeClose<cr>', { noremap = true })
---- Ripgrep ---- Ripgrep
map('n', '<C-f>', ':Rg<cr>') map('n', '<C-f>', ':Rg<cr>')
---- Auto-complete ---- Auto-complete
@ -126,7 +133,7 @@ local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
end end
local cmp_capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) local cmp_capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
local servers = { 'clojure_lsp', 'gopls', 'clangd', 'tsserver' } local servers = { 'clojure_lsp', 'gopls', 'clangd', 'tsserver', 'solargraph' }
for _, lsp in pairs(servers) do for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup { require('lspconfig')[lsp].setup {
on_attach = on_attach, on_attach = on_attach,
@ -136,6 +143,7 @@ for _, lsp in pairs(servers) do
} }
} }
end end
-- Java auto complete/LSP -- Java auto complete/LSP
local jdtls_cfg = { local jdtls_cfg = {
cmd = { cmd = {
@ -159,7 +167,6 @@ if vim.bo.filetype == 'java' then
end end
-- 2 Tab space standard languages -- 2 Tab space standard languages
-- Clojure and Common Lisp style is 2 space indent
vim.cmd([[ vim.cmd([[
autocmd Filetype ruby,rb,clojure,clj,lisp,lsp,cl,l,javascript,js,typescript,ts setlocal tabstop=2 shiftwidth=2 autocmd Filetype ruby,rb,clojure,clj,lisp,lsp,cl,l,javascript,js,typescript,ts setlocal tabstop=2 shiftwidth=2
]]) ]])