fixing set issue

This commit is contained in:
spinach 2023-04-17 14:35:27 -04:00
commit bd6699a1c6
4 changed files with 55 additions and 12 deletions

8
.gitmodules vendored
View File

@ -7,9 +7,6 @@
[submodule "telescope.nvim"] [submodule "telescope.nvim"]
path = site/pack/filebrowser/start/telescope.nvim path = site/pack/filebrowser/start/telescope.nvim
url = https://github.com/nvim-telescope/telescope.nvim.git url = https://github.com/nvim-telescope/telescope.nvim.git
[submodule "vim-go"]
path = site/pack/golang/opt/vim-go
url = https://github.com/fatih/vim-go.git
[submodule "markdown-preview.nvim"] [submodule "markdown-preview.nvim"]
path = site/pack/markdown/start/markdown-preview.nvim path = site/pack/markdown/start/markdown-preview.nvim
url = https://github.com/iamcco/markdown-preview.nvim.git url = https://github.com/iamcco/markdown-preview.nvim.git
@ -40,6 +37,9 @@
[submodule "nvim-lspconfig"] [submodule "nvim-lspconfig"]
path = site/pack/lsp/start/nvim-lspconfig path = site/pack/lsp/start/nvim-lspconfig
url = https://github.com/neovim/nvim-lspconfig.git url = https://github.com/neovim/nvim-lspconfig.git
[submodule "site/pack/qol/start/harpoon"] [submodule "vim-go"]
path = site/pack/golang/start/vim-go
url = https://github.com/fatih/vim-go.git
[submodule "harpoon"]
path = site/pack/qol/start/harpoon path = site/pack/qol/start/harpoon
url = https://github.com/ThePrimeagen/harpoon.git url = https://github.com/ThePrimeagen/harpoon.git

View File

@ -2,6 +2,7 @@ require('keymap')
require('plugins') require('plugins')
require('calcurse') require('calcurse')
require('i3conf') require('i3conf')
require('go')
-- prevent cursor override -- prevent cursor override
vim.cmd('set guicursor=') vim.cmd('set guicursor=')
@ -9,6 +10,11 @@ vim.cmd('set guicursor=')
vim.cmd('filetype plugin indent on') vim.cmd('filetype plugin indent on')
vim.cmd('set ts=4 sts=4 sw=4 expandtab') vim.cmd('set ts=4 sts=4 sw=4 expandtab')
-- clipboard
vim.cmd('set clipboard+=unnamedplus')
vim.keymap.set('n', '<leader>Y', '"+y')
vim.keymap.set('n', '<leader>P', '"+p')
-- hybrid numbering -- hybrid numbering
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.number = true vim.opt.number = true
@ -33,6 +39,7 @@ Transparent = true
-- timeouts -- timeouts
vim.opt.ttimeout = true vim.opt.ttimeout = true
vim.opt.ttimeoutlen = 100 vim.opt.ttimeoutlen = 100
vim.o.updatetime = 250
-- nvim tree basics -- nvim tree basics
@ -50,7 +57,7 @@ local lspconfig = require('lspconfig')
-- Go -- Go
lspconfig.gopls.setup{ lspconfig.gopls.setup{
cmd = {"gopls", "server"}, cmd = {"gopls", "serve"},
filetypes = {"go", "gomod"}, filetypes = {"go", "gomod"},
settings = { settings = {
gopls = { gopls = {
@ -86,8 +93,45 @@ lspconfig.pylsp.setup{}
-- TypeScript -- TypeScript
lspconfig.tsserver.setup{} lspconfig.tsserver.setup{}
-- lsp mappingsd -- Fix virtual text going off screen
vim.keymap.set('n', '<leader>gD', vim.lsp.buf.declaration, opts) vim.diagnostic.config({
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.definition, opts) virtual_text = false,
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts) signs = true,
vim.keymap.set('n', '<leader>H', vim.lsp.buf.hover, opts) underline = true,
update_in_insert = false,
severity_sort = false,
})
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(ev)
-- custom colors
vim.cmd('hi DiagnosticUnderlineError cterm=undercurl guisp=Red')
-- key mappings
local opts = { buffer = ev.buf,}
-- error viewing
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '<leader>[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', '<leader>]d', vim.diagnostic.goto_next, opts)
-- def viewing/rename
vim.keymap.set('n', '<leader>gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
vim.keymap.set('n', '<leader>H', vim.lsp.buf.hover, opts)
-- auto hover for error viewing
vim.api.nvim_create_autocmd("CursorHold", {
callback = function()
opts = {
buffer = ev.buf,
focusable = false,
border = 'rounded',
source = 'always',
prefix = ' ',
scope = 'cursor',
close_events = { "BufLeave","CursorMoved","InsertEnter","FocusLost" },
}
vim.diagnostic.open_float(nil, opts)
end
})
end,
})

View File

@ -1,5 +1,3 @@
vim.cmd('packadd vim-go')
vim.g.go_hightlight_types = 1 vim.g.go_hightlight_types = 1
vim.g.go_hightlight_fields = 1 vim.g.go_hightlight_fields = 1
vim.g.go_hightlight_functions = 1 vim.g.go_hightlight_functions = 1

@ -0,0 +1 @@
Subproject commit a494378f6c106a97e39c62b493c14476f9f7de4f