This commit is contained in:
abs3nt 2023-03-02 01:13:40 -08:00
parent d5bfc57e35
commit 893c861476
3 changed files with 12 additions and 25 deletions

View File

@ -70,16 +70,6 @@ function Toggleln()
end end
end end
---- trim whitespace on save
autocmd("BufWritePre", {
pattern = "*",
callback = function()
vim.cmd([[:%s/\s\+$//e]])
end,
once = false,
group = _group,
})
-- change tmux title -- change tmux title
autocmd("BufReadPost", { autocmd("BufReadPost", {
pattern = "*", pattern = "*",
@ -150,6 +140,3 @@ autocmd('BufUnload', {
vim.opt.cmdheight = 1 vim.opt.cmdheight = 1
end, end,
}) })
-- syntax fix
vim.cmd("syntax sync fromstart")

View File

@ -15,6 +15,7 @@ vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
local on_attach = function(client, bufnr) local on_attach = function(client, bufnr)
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
-- Enable completion triggered by <c-x><c-o> -- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
if client.server_capabilities.colorProvider then if client.server_capabilities.colorProvider then

View File

@ -30,20 +30,19 @@ return require('packer').startup({ function(use)
use 'ray-x/guihua.lua' use 'ray-x/guihua.lua'
use { use 'ctrlpvim/ctrlp.vim'
'ray-x/go.nvim',
ft = { "go" }, use({
'fatih/vim-go',
config = function() config = function()
require("go").setup({ vim.g.go_fmt_command = "gofumpt"
max_line_len = 120, vim.g.go_highlight_types = 1
tag_transform = false, vim.g.go_highlight_fields = 1
test_dir = '', vim.g.go_highlight_functions = 1
comment_placeholder = '', vim.g.go_highlight_function_calls = 1
lsp_cfg = true, -- false: use your own lspconfig vim.g.go_auto_type_info = 1
dap_debug = true,
})
end end
} })
-- obsession -- obsession
use 'tpope/vim-obsession' use 'tpope/vim-obsession'