mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-22 18:38:00 +00:00
[neovim] Clean up
This commit is contained in:
parent
adefa851d7
commit
e6f3c13e25
@ -14,15 +14,6 @@ vim.api.nvim_create_autocmd({ "TextYankPost" }, {
|
||||
end,
|
||||
})
|
||||
|
||||
-- Set wrap and spell in markdown and gitcommit
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
pattern = { "gitcommit", "markdown" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- Set expandtab=true in several file types
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
pattern = { "go", "makefile", "lua" },
|
||||
|
@ -5,7 +5,7 @@ if not status_ok then
|
||||
end
|
||||
|
||||
npairs.setup({
|
||||
check_ts = true, -- treesitter integration
|
||||
check_ts = true,
|
||||
disable_filetype = { "TelescopePrompt", "neo-tree" },
|
||||
ts_config = {
|
||||
lua = { "string", "source" },
|
||||
@ -14,7 +14,7 @@ npairs.setup({
|
||||
map = "<M-e>",
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
offset = 0, -- Offset from pattern match
|
||||
offset = 0,
|
||||
end_key = "$",
|
||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
|
@ -21,7 +21,7 @@ gitsigns.setup({
|
||||
update_debounce = 100,
|
||||
status_formatter = nil,
|
||||
preview_config = {
|
||||
border = "single",
|
||||
border = "rounded",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
|
@ -62,11 +62,6 @@ local function lsp_keymaps(bufnr)
|
||||
keymap(bufnr, "n", "<leader>lk", "<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>ls", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
-- keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
-- keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
-- keymap(bufnr, "n", "gI", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
-- keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
-- keymap(bufnr, "n", "<leader>lq", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
|
||||
end
|
||||
|
||||
M.on_attach = function(client, bufnr)
|
||||
|
@ -1,4 +1,4 @@
|
||||
local status_ok, _ = pcall(require, "lspconfig")
|
||||
local status_ok, win = pcall(require, "lspconfig.ui.windows")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
@ -6,3 +6,5 @@ end
|
||||
require("user.lsp.mason")
|
||||
require("user.lsp.handlers").setup()
|
||||
require("user.lsp.null-ls")
|
||||
|
||||
win.default_options.border = 'rounded'
|
||||
|
@ -1,17 +1,16 @@
|
||||
local servers = {
|
||||
"sumneko_lua",
|
||||
"cssls",
|
||||
"html",
|
||||
"gopls",
|
||||
"pyright",
|
||||
"bashls",
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
"ansiblels",
|
||||
}
|
||||
|
||||
local settings = {
|
||||
ui = {
|
||||
border = "none",
|
||||
border = "rounded",
|
||||
icons = {
|
||||
package_installed = "◍",
|
||||
package_pending = "◍",
|
||||
|
@ -8,22 +8,14 @@ local formatting = null_ls.builtins.formatting
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
|
||||
-- https://github.com/prettier-solidity/prettier-plugin-solidity
|
||||
null_ls.setup({
|
||||
debug = false,
|
||||
sources = {
|
||||
formatting.prettier.with({
|
||||
extra_filetypes = { "toml" },
|
||||
extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" },
|
||||
}),
|
||||
formatting.black.with({ extra_args = { "--fast" } }),
|
||||
formatting.stylua,
|
||||
diagnostics.golangci_lint.with({ extra_args = { "--fast" } }),
|
||||
diagnostics.flake8.with({
|
||||
extra_args = { "--max-line-length=120" },
|
||||
}),
|
||||
diagnostics.cfn_lint,
|
||||
diagnostics.shellcheck,
|
||||
diagnostics.hadolint,
|
||||
diagnostics.markdownlint,
|
||||
},
|
||||
})
|
||||
|
@ -23,7 +23,7 @@ vim.opt.updatetime = 300 -- faster completion (4000ms default)
|
||||
vim.opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
||||
vim.opt.cursorline = true -- highlight the current line
|
||||
vim.opt.number = true -- set numbered lines
|
||||
vim.opt.laststatus = 3
|
||||
vim.opt.laststatus = 3 -- the last window will have a status line always and ONLY the last window
|
||||
vim.opt.showcmd = false
|
||||
vim.opt.ruler = false
|
||||
-- vim.opt.cc = "80"
|
||||
@ -32,7 +32,6 @@ vim.opt.list = true
|
||||
vim.opt.expandtab = true -- convert tabs to spaces
|
||||
vim.opt.shiftwidth = 4 -- the number of spaces inserted for each indentation
|
||||
vim.opt.tabstop = 4 -- insert 4 spaces for a tab
|
||||
vim.opt.numberwidth = 4 -- set number column width to 2 {default 4}
|
||||
vim.opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time
|
||||
vim.opt.wrap = false -- display lines as one long line
|
||||
vim.opt.scrolloff = 8
|
||||
|
@ -22,13 +22,11 @@ end
|
||||
-- augroup end
|
||||
-- ]])
|
||||
|
||||
-- Use a protected call so we don't error out on first use
|
||||
local status_ok, packer = pcall(require, "packer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- Have packer use a popup window
|
||||
packer.init({
|
||||
display = {
|
||||
open_fn = function()
|
||||
@ -37,7 +35,6 @@ packer.init({
|
||||
},
|
||||
})
|
||||
|
||||
-- Install your plugins here
|
||||
return packer.startup(function(use)
|
||||
-- Plugins
|
||||
use({ "wbthomason/packer.nvim", commit = "6afb67460283f0e990d35d229fd38fdc04063e0a" })
|
||||
@ -75,7 +72,7 @@ return packer.startup(function(use)
|
||||
use({ "saadparwaiz1/cmp_luasnip", commit = "a9de941bcbda508d0a45d28ae366bb3f08db2e36" })
|
||||
use({ "hrsh7th/cmp-nvim-lsp", commit = "affe808a5c56b71630f17aa7c38e15c59fd648a8" })
|
||||
|
||||
-- snippets
|
||||
-- Snippets
|
||||
use({ "L3MON4D3/LuaSnip", tag = "v1.*" })
|
||||
use({ "rafamadriz/friendly-snippets", commit = "6cd7469403fd06a3840a1065728d1affe1c23ec8" })
|
||||
|
||||
@ -107,7 +104,7 @@ return packer.startup(function(use)
|
||||
use({ "ravenxrz/DAPInstall.nvim", commit = "8798b4c36d33723e7bba6ed6e2c202f84bb300de" })
|
||||
use({ "theHamsta/nvim-dap-virtual-text", commit = "2971ce3e89b1711cc26e27f73d3f854b559a77d4" })
|
||||
|
||||
-- golang
|
||||
-- Go
|
||||
use({ "ray-x/go.nvim", commit = "1aef2d60bd220a8d58a0b5fed6af696b6244ce1d" })
|
||||
use({
|
||||
"ray-x/guihua.lua",
|
||||
@ -121,7 +118,7 @@ return packer.startup(function(use)
|
||||
end,
|
||||
})
|
||||
|
||||
-- markdown
|
||||
-- Markdown
|
||||
use({ "mzlogin/vim-markdown-toc", commit = "7ec05df27b4922830ace2246de36ac7e53bea1db" })
|
||||
use({
|
||||
"iamcco/markdown-preview.nvim",
|
||||
|
Loading…
Reference in New Issue
Block a user