Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8917eae531 | ||
|
|
5178f457ec |
6 changed files with 37 additions and 16 deletions
5
init.lua
5
init.lua
|
|
@ -1,5 +1,4 @@
|
||||||
require('settings')
|
require('settings')
|
||||||
require('keymappings')
|
|
||||||
require('nv-globals')
|
require('nv-globals')
|
||||||
require('plugins')
|
require('plugins')
|
||||||
require('colorscheme')
|
require('colorscheme')
|
||||||
|
|
@ -10,8 +9,8 @@ require('keymappings')
|
||||||
require('lsp')
|
require('lsp')
|
||||||
require('lsp.typescript-ls')
|
require('lsp.typescript-ls')
|
||||||
require('lsp.python-ls')
|
require('lsp.python-ls')
|
||||||
require('lsp.lua-ls')
|
-- require('lsp.lua-ls')
|
||||||
require('lsp.elixir-ls')
|
-- require('lsp.elixir-ls')
|
||||||
require('lsp.go-ls')
|
require('lsp.go-ls')
|
||||||
require('lsp.ocaml-ls')
|
require('lsp.ocaml-ls')
|
||||||
-- require('lsp.sml-ls')
|
-- require('lsp.sml-ls')
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,11 @@ vim.api.nvim_set_keymap('t', '<C-g>', '<ESC>', {silent = true})
|
||||||
-- Move right when in insert mode.
|
-- Move right when in insert mode.
|
||||||
vim.api.nvim_set_keymap("i", '<C-l>', '<Right>', {noremap = true, silent = true})
|
vim.api.nvim_set_keymap("i", '<C-l>', '<Right>', {noremap = true, silent = true})
|
||||||
|
|
||||||
|
-- Easily move between windows
|
||||||
|
vim.api.nvim_set_keymap("n", '<Leader>wm', '<C-w>h', {silent = true})
|
||||||
|
vim.api.nvim_set_keymap("n", '<Leader>wn', '<C-w>j', {silent = true})
|
||||||
|
vim.api.nvim_set_keymap("n", '<Leader>we', '<C-w>k', {silent = true})
|
||||||
|
vim.api.nvim_set_keymap("n", '<Leader>wi', '<C-w>l', {silent = true})
|
||||||
|
|
||||||
-- Quick save.
|
-- Quick save.
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>fw', ':w<CR>', {silent = true})
|
vim.api.nvim_set_keymap('n', '<Leader>fw', ':w<CR>', {silent = true})
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ lspconfig.gopls.setup {
|
||||||
-- floating_window = true,
|
-- floating_window = true,
|
||||||
--hint_enable = true,
|
--hint_enable = true,
|
||||||
fix_pos = true,
|
fix_pos = true,
|
||||||
use_lspsaga = true,
|
-- use_lspsaga = true,
|
||||||
handler_opts = {
|
handler_opts = {
|
||||||
border = "rounded" -- double, single, shadow, none
|
border = "rounded" -- double, single, shadow, none
|
||||||
},
|
},
|
||||||
|
|
@ -28,7 +28,7 @@ lspconfig.gopls.setup {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
------ Configre vim-go
|
------ Configure vim-go
|
||||||
-- Disable autocomplete since we already have it with native lsp.
|
-- Disable autocomplete since we already have it with native lsp.
|
||||||
vim.g.go_code_completion_enabled = 0
|
vim.g.go_code_completion_enabled = 0
|
||||||
-- Disable gopls for the same reasons as above.
|
-- Disable gopls for the same reasons as above.
|
||||||
|
|
@ -39,8 +39,9 @@ vim.g.go_fmt_command = 'gofmt'
|
||||||
vim.g.go_fmt_options = {
|
vim.g.go_fmt_options = {
|
||||||
gofmt = '-s',
|
gofmt = '-s',
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.g.go_imports_mode = 'goimports'
|
vim.g.go_imports_mode = 'goimports'
|
||||||
|
vim.g.go_mod_fmt_autosave = 1
|
||||||
|
vim.g.go_imports_autosave = 1
|
||||||
|
|
||||||
-- Could confilg with lsp saga, should experiment.
|
-- Could confilg with lsp saga, should experiment.
|
||||||
vim.g.go_doc_keywordprg_enabled = 0
|
vim.g.go_doc_keywordprg_enabled = 0
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
local lsp = vim.lsp
|
local lsp = vim.lsp
|
||||||
local handlers = lsp.handlers
|
local handlers = lsp.handlers
|
||||||
|
local keymap = vim.keymap.set
|
||||||
|
|
||||||
-- Hover doc popup
|
-- Hover doc popup
|
||||||
local pop_opts = { border = "rounded", max_width = 80 }
|
local pop_opts = { border = "rounded", max_width = 80 }
|
||||||
|
|
@ -10,5 +11,7 @@ vim.api.nvim_set_keymap('n', '<Leader>lgd', '<cmd>lua vim.lsp.buf.definition()<C
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>lgD', '<cmd>lua vim.lsp.buf.declaration()<CR>', {noremap = true, silent = true})
|
vim.api.nvim_set_keymap('n', '<Leader>lgD', '<cmd>lua vim.lsp.buf.declaration()<CR>', {noremap = true, silent = true})
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>lgr', '<cmd>lua vim.lsp.buf.references()<CR>', {noremap = true, silent = true})
|
vim.api.nvim_set_keymap('n', '<Leader>lgr', '<cmd>lua vim.lsp.buf.references()<CR>', {noremap = true, silent = true})
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>lgi', '<cmd>lua vim.lsp.buf.implementation()<CR>', {noremap = true, silent = true})
|
vim.api.nvim_set_keymap('n', '<Leader>lgi', '<cmd>lua vim.lsp.buf.implementation()<CR>', {noremap = true, silent = true})
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>lr', '<cmd>lua require("lspsaga.rename").rename()<CR>', {noremap = true, silent = true})
|
-- vim.api.nvim_set_keymap('n', '<Leader>lr', '<cmd>lua require("lspsaga.rename").rename()<CR>', {noremap = true, silent = true})
|
||||||
|
-- Rename all occurrences of the hovered word for the selected files
|
||||||
|
keymap("n", "<Leader>lr", "<cmd>Lspsaga rename ++project<CR>")
|
||||||
vim.api.nvim_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', {noremap = true, silent = true})
|
vim.api.nvim_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', {noremap = true, silent = true})
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,3 @@ require'lspconfig'.tsserver.setup{
|
||||||
filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" },
|
filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" },
|
||||||
root_dir = require('lspconfig/util').root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")
|
root_dir = require('lspconfig/util').root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")
|
||||||
}
|
}
|
||||||
|
|
||||||
local saga = require 'lspsaga'
|
|
||||||
saga.init_lsp_saga()
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,23 @@ return require('packer').startup(function(use)
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
use 'neovim/nvim-lspconfig'
|
use 'neovim/nvim-lspconfig'
|
||||||
use 'glepnir/lspsaga.nvim'
|
use({
|
||||||
|
'nvimdev/lspsaga.nvim',
|
||||||
|
after = 'nvim-lspconfig',
|
||||||
|
config = function()
|
||||||
|
require("lspsaga").setup({
|
||||||
|
lightbulb = {
|
||||||
|
enable = false,
|
||||||
|
sign = false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
requires = {
|
||||||
|
{"nvim-tree/nvim-web-devicons"},
|
||||||
|
--Please make sure you install markdown and markdown_inline parser
|
||||||
|
{"nvim-treesitter/nvim-treesitter"}
|
||||||
|
}
|
||||||
|
})
|
||||||
use 'kabouzeid/nvim-lspinstall'
|
use 'kabouzeid/nvim-lspinstall'
|
||||||
-- Autocomplete
|
-- Autocomplete
|
||||||
use 'hrsh7th/nvim-compe'
|
use 'hrsh7th/nvim-compe'
|
||||||
|
|
@ -27,11 +43,11 @@ return require('packer').startup(function(use)
|
||||||
|
|
||||||
-- Syntax
|
-- Syntax
|
||||||
use 'sheerun/vim-polyglot'
|
use 'sheerun/vim-polyglot'
|
||||||
use {
|
-- use {
|
||||||
'prettier/vim-prettier',
|
-- 'prettier/vim-prettier',
|
||||||
run = "yarn install",
|
-- run = "yarn install",
|
||||||
ft = {"javascript", "typescript", "json"}
|
-- ft = {"javascript", "typescript", "json"}
|
||||||
}
|
-- }
|
||||||
use {'styled-components/vim-styled-components', branch = "main"}
|
use {'styled-components/vim-styled-components', branch = "main"}
|
||||||
use 'dominikduda/vim_current_word'
|
use 'dominikduda/vim_current_word'
|
||||||
use {
|
use {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue