fix lsp + conform + sleuth

scratch
Gabe Farrell 2 years ago
parent 91ba5541a3
commit cc4abb76ee

@ -3,27 +3,27 @@ vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
-- nvchad ui stuff
vim.g.base46_cache = vim.fn.stdpath('data') .. '/base46_cache/'
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46_cache/"
vim.g.mapleader = " "
vim.keymap.set({'n', 'v'}, "<Left>", "")
vim.keymap.set({'n', 'v'}, "<Down>", "")
vim.keymap.set({'n', 'v'}, "<Up>", "")
vim.keymap.set({'n', 'v'}, "<Right>", "")
vim.keymap.set({ "n", "v" }, "<Left>", "")
vim.keymap.set({ "n", "v" }, "<Down>", "")
vim.keymap.set({ "n", "v" }, "<Up>", "")
vim.keymap.set({ "n", "v" }, "<Right>", "")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
vim.fn.system {
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
}
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ import = "plugins" })
require("lazy").setup { import = "plugins" }
-- more nvchad ui stuff
-- dofile(vim.g.base46_cache .. "defaults")

@ -1,23 +0,0 @@
local lsp_zero = require('lsp-zero')
lsp_zero.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp_zero.default_keymaps({buffer = bufnr})
end)
-- here you can setup the language servers
require('mason').setup({})
require('mason-lspconfig').setup({
ensure_installed = {
'tsserver',
'rust_analyzer',
'gopls',
'clangd',
}
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({})
end,
}
})

@ -1,8 +1,14 @@
return {
ensure_installed = {
"lua", "luadoc", "printf",
"vim", "vimdoc", "go",
"ruby", "rust", "cpp",
"lua",
"luadoc",
"printf",
"vim",
"vimdoc",
"go",
"ruby",
"rust",
"cpp",
},
highlight = {
enable = true,

@ -6,7 +6,7 @@ M.ui = {
hl_add = {},
hl_override = {
Comment = { italic = true },
['@comment'] = { italic = true },
["@comment"] = { italic = true },
},
changed_themes = {},
theme_toggle = { "onedark", "one_light" },
@ -48,7 +48,8 @@ M.ui = {
[[ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ]],
[[ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ]],
[[ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ]],
[[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]], },
[[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]],
},
buttons = {
{ " Find File", "Spc f f", "Telescope find_files" },

@ -1,8 +1,34 @@
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
opts = {
format_on_save = function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return { timeout_ms = 3000, lsp_fallback = true }
end,
formatters_by_ft = {
bash = { "shfmt" },
sh = { "shfmt" },
fish = { "fish_indent" },
lua = { "stylua" },
go = { "goimports", "gofumpt", "goimports-reviser" },
javascript = { { "prettierd", "prettier" } },
typescript = { { "prettierd", "prettier" } },
javascriptreact = { { "prettierd", "prettier" } },
typescriptreact = { { "prettierd", "prettier" } },
vue = { { "prettierd", "prettier" } },
css = { { "prettierd", "prettier" } },
scss = { { "prettierd", "prettier" } },
less = { { "prettierd", "prettier" } },
html = { { "prettierd", "prettier" } },
json = { { "prettierd", "prettier" } },
jsonc = { { "prettierd", "prettier" } },
yaml = { { "prettierd", "prettier" } },
markdown = { { "prettierd", "prettier" } },
["markdown.mdx"] = { { "prettierd", "prettier" } },
},
},
config = function(_, opts)

@ -2,7 +2,7 @@ return {
"lewis6991/gitsigns.nvim",
event = "User FilePost",
opts = function()
return require("configs.gitsigns")
return require "configs.gitsigns"
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "git")

@ -15,4 +15,3 @@ return {
dofile(vim.g.base46_cache .. "blankline")
end,
}

@ -1,16 +1,44 @@
return {
{
'williamboman/mason.nvim',
"williamboman/mason.nvim",
cmd = { "Mason", "MasonInstall", "MasonUpdate" },
config = function(_, opts_)
config = function(_, opts)
dofile(vim.g.base46_cache .. "mason")
require('mason').setup(opts)
require("mason").setup(opts)
end,
},
{'williamboman/mason-lspconfig.nvim'},
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'},
{'neovim/nvim-lspconfig'},
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'},
{'L3MON4D3/LuaSnip'},
{ "williamboman/mason-lspconfig.nvim" },
{
"VonHeikemen/lsp-zero.nvim",
branch = "v3.x",
config = function()
local lsp_zero = require "lsp-zero"
lsp_zero.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp_zero.default_keymaps { buffer = bufnr }
end)
-- here you can setup the language servers
require("mason").setup {}
require("mason-lspconfig").setup {
ensure_installed = {
"tsserver",
"rust_analyzer",
"gopls",
"clangd",
"lua_ls",
"pyright",
},
handlers = {
function(server_name)
require("lspconfig")[server_name].setup {}
end,
},
}
end,
},
{ "neovim/nvim-lspconfig" },
{ "hrsh7th/cmp-nvim-lsp" },
{ "hrsh7th/nvim-cmp" },
{ "L3MON4D3/LuaSnip" },
}

@ -1,12 +1,12 @@
return {
"NvChad/nvim-colorizer.lua",
-- event = "User FilePost",
-- opts = { user_default_options = { names = false } },
-- config = function(_, opts)
-- require('colorizer').setup(opts)
--
-- vim.defer_fn(function()
-- require('colorizer').attach_to_buffer(0)
-- end, 0)
-- end,
event = "User FilePost",
opts = { user_default_options = { names = false } },
config = function(_, opts)
require("colorizer").setup(opts)
vim.defer_fn(function()
require("colorizer").attach_to_buffer(0)
end, 0)
end,
}

@ -12,7 +12,7 @@ return {
config = function(_, opts)
dofile(vim.g.base46_cache .. "devicons")
require("nvim-web-devicons").setup(opts)
end
end,
},
opts = function()
return require "configs.nvim-tree"

@ -1,5 +1,5 @@
local map = vim.keymap.set
return {
"nvim-telescope/telescope.nvim",
dependencies = { 'nvim-lua/plenary.nvim' },
dependencies = { "nvim-lua/plenary.nvim" },
}

@ -12,4 +12,3 @@ return {
require("nvim-treesitter.configs").setup(opts)
end,
}

@ -0,0 +1,3 @@
return {
"timpope/vim-sleuth",
}

@ -1,6 +1,6 @@
local map = vim.keymap.set
-- general mappings
map('n', ';', ':')
map("n", ";", ":")
map("n", "<leader>rn", "<cmd>set rnu!<CR>", { desc = "Toggle Relative number" })
map("n", "<C-s>", "<cmd>w<CR>", { desc = "File Save" })
map("n", "<C-h>", "<C-w>h", { desc = "Switch Window left" })
@ -10,18 +10,18 @@ map("n", "<C-k>", "<C-w>k", { desc = "Switch Window up" })
map("n", "<leader>qq", ":wa<CR>:qa<CR>")
-- telescope keybinds
local builtin = require('telescope.builtin')
map('n', '<leader>ff', builtin.find_files, { desc = '[f]ind [f]ile' })
map('n', '<leader>pg', builtin.live_grep, { desc = '[p]roject [g]rep' })
map('n', '<leader>fb', builtin.buffers, { desc = '[f]ind [b]uffer' })
map('n', '<leader>fh', builtin.help_tags, { desc = '[f]ind [h]elp' })
local builtin = require "telescope.builtin"
map("n", "<leader>ff", builtin.find_files, { desc = "[f]ind [f]ile" })
map("n", "<leader>pg", builtin.live_grep, { desc = "[p]roject [g]rep" })
map("n", "<leader>fb", builtin.buffers, { desc = "[f]ind [b]uffer" })
map("n", "<leader>fh", builtin.help_tags, { desc = "[f]ind [h]elp" })
map("n", "<leader>fg", "<cmd>Telescope current_buffer_fuzzy_find<CR>", { desc = "[f]ile [g]rep" })
-- base46 maps
map('n', '<leader>th', '<cmd>Telescope themes<CR>', { desc = '[th]emes' })
map("n", "<leader>th", "<cmd>Telescope themes<CR>", { desc = "[th]emes" })
-- nvim-tree mapping
map('n', '<leader>e', '<cmd>NvimTreeOpen<CR>')
map("n", "<leader>e", "<cmd>NvimTreeOpen<CR>")
-- comment
map("n", "<leader>/", function()

Loading…
Cancel
Save