rm dotbot; move everything to home manager

This commit is contained in:
cy 2024-12-15 02:14:00 -05:00
parent cedd2c1983
commit c1b64baea7
39 changed files with 7 additions and 37 deletions

View file

@ -0,0 +1,21 @@
local keymap = vim.keymap
local fzf = require("fzf-lua")
keymap.set("n", "<leader>ff", fzf.files, { silent = true })
keymap.set("n", "<leader>fr", fzf.oldfiles, { silent = true })
keymap.set("n", "<leader>fc", fzf.resume, { silent = true })
keymap.set("n", "<leader>fs", fzf.treesitter, { silent = true })
keymap.set("n", "<leader>fg", fzf.grep_project, { silent = true })
fzf.setup {
"fzf-native",
keymap = {
fzf = {
["ctrl-u"] = "half-page-up",
["ctrl-d"] = "half-page-down",
["ctrl-j"] = "preview-page-down",
["ctrl-k"] = "preview-page-up",
}
}
}

View file

@ -0,0 +1,16 @@
local hop = require('hop')
local keymap = vim.keymap
hop.setup {
case_insensitive = true;
char2_fallback_key = "<CR>",
quit_key = "<Esc",
}
keymap.set({ 'n', 'v', 'o' }, 'f', "", {
silent = true;
noremap = true;
callback = function()
hop.hint_char2()
end,
})

View file

@ -0,0 +1,75 @@
local lsp = vim.lsp
local diagnostic = vim.diagnostic
local keymap = vim.keymap
keymap.set("n", "gd", lsp.buf.definition)
keymap.set("n", "<space>rn", lsp.buf.rename)
keymap.set("n", "gr", lsp.buf.references)
keymap.set("n", "[d", diagnostic.goto_prev)
keymap.set("n", "]d", diagnostic.goto_next)
diagnostic.config {
signs = false,
}
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.pylsp.setup { capabilities = capabilities }
lspconfig.clangd.setup { capabilities = capabilities }
lspconfig.vimls.setup { capabilities = capabilities }
lspconfig.bashls.setup { capabilities = capabilities }
lspconfig.rust_analyzer.setup {
capabilities = capabilities,
}
lspconfig.gopls.setup {
settings = {
gopls = {
analyses = {
unusedparams = true,
},
staticcheck = true,
gofumpt = true,
}
},
capabilities = capabilities,
}
lspconfig.lua_ls.setup {
capabilities = capabilities,
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if vim.uv.fs_stat(path..'/.luarc.json') or vim.uv.fs_stat(path..'/.luarc.jsonc') then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT'
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME
-- Depending on the usage, you might want to add additional paths here.
-- "${3rd}/luv/library"
-- "${3rd}/busted/library",
}
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
-- library = vim.api.nvim_get_runtime_file("", true)
}
})
end,
settings = {
Lua = {}
}
}
lspconfig.nixd.setup { capabilities = capabilities }
lspconfig.sqls.setup { capabilities = capabilities }

View file

@ -0,0 +1,54 @@
local cmp = require("cmp")
local luasnip = require("luasnip");
cmp.setup {
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
mapping = {
["<C-e"] = cmp.mapping.abort(),
["<C-k>"] = cmp.mapping(function(fallback)
if cmp.visible() then
if luasnip.expandable() then
luasnip.expand()
else
cmp.confirm({
select = true,
})
end
else
fallback()
end
end),
["<C-n>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.locally_jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { "i", "s" }),
["<C-p>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
sources = cmp.config.sources ({
{ name = "nvim_lsp" },
{ name = "luasnip" },
}, {
{ name = "buffer" },
{ name = "path" },
})
}

View file

@ -0,0 +1,99 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = ","
local plugin_specs = {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = "VeryLazy",
},
{
"neovim/nvim-lspconfig",
event = { "BufRead", "BufNewFile" },
config = function()
require("config.lsp")
end,
},
{
"hrsh7th/nvim-cmp",
event = 'VeryLazy',
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-omni",
"hrsh7th/cmp-cmdline",
"saadparwaiz1/cmp_luasnip",
},
config = function()
require("config.nvim-cmp")
end,
},
{
"L3MON4D3/LuaSnip",
version = "v2.*",
build = "make install_jsregexp",
},
{ "stevearc/dressing.nvim", event = "VeryLazy" },
{
"nvim-tree/nvim-tree.lua",
lazy = false,
dependencies = {
"nvim-tree/nvim-web-devicons",
},
},
{
"ibhagwan/fzf-lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("config.fzf")
end,
},
{ "windwp/nvim-autopairs", event = "InsertEnter", config = true },
{ "tpope/vim-commentary", event = "VeryLazy" },
{ "folke/tokyonight.nvim", lazy = false, priority = 1000 },
{ "lewis6991/gitsigns.nvim"},
{ "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" } },
{ "github/copilot.vim", lazy = false },
{
'smoka7/hop.nvim',
version = "*",
config = function()
require("config.hop")
end,
}
}
require("lazy").setup({
spec = plugin_specs,
rocks = { enabled = true },
})