mirror of
https://git.sr.ht/~danbarber/dotfiles
synced 2025-03-04 08:59:18 +00:00
Add Neovim config
This commit is contained in:
parent
4b8cfc77ea
commit
4a57ce9530
7
dot_config/nvim/init.lua
Normal file
7
dot_config/nvim/init.lua
Normal file
@ -0,0 +1,7 @@
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
require("config.filetypes")
|
||||
require("config.keymaps")
|
||||
require("config.lazy")
|
||||
require("config.options")
|
||||
require("config.lsp")
|
||||
53
dot_config/nvim/lazy-lock.json
Normal file
53
dot_config/nvim/lazy-lock.json
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
"ascii.nvim": { "branch": "master", "commit": "c1a315e811fa7c133f8f4827e63015a480d8a81b" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
|
||||
"colortils.nvim": { "branch": "main", "commit": "3d3a96e61fff6bd3b19685210aea0aa146b64de1" },
|
||||
"dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" },
|
||||
"filetype.nvim": { "branch": "main", "commit": "15891eb2b138d54b08aef793c43901910ec6879f" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "356df59308d8b87486644d2324d7558ac0f3db36" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "f491b0fe68fffbece7030181073dfe51f45cda81" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" },
|
||||
"lspkind-nvim": { "branch": "master", "commit": "59c3f419af48a2ffb2320cea85e44e5a95f71664" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
|
||||
"nerdcommenter": { "branch": "master", "commit": "3f860f2d981547c18f2c9599e3c358ea488c3be4" },
|
||||
"none-ls-extras.nvim": { "branch": "main", "commit": "ebb09961f1c0a377f9ed1685740cdf87b5cd39a8" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "68a39ec218a9f15ebb2bb36c8c245681d5e61144" },
|
||||
"nordic.nvim": { "branch": "main", "commit": "1ee4044077059b34eacd18d93613495a602c131f" },
|
||||
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||
"nvim-highlight-colors": { "branch": "main", "commit": "a411550ef85cae467b889ba7d1a96bd78332d90e" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "a9bc587e9ae0cbcb3e90a2e9342f86b3b78c4408" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "679883ad31f1752cac92a4ca182cee8b2751d4f1" },
|
||||
"nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "26220156aafb198b2de6a4cf80c1b120a3768da0" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "cb3f98d935842836cc115e8c9e4b38c1380fbb6b" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "817bb6ffff1b9ce72cdd45d9fcfa8c9cd1ad3839" },
|
||||
"treesj": { "branch": "main", "commit": "0d81326b5afd36babe7dd480aabbb0b05f33e688" },
|
||||
"vim-bundler": { "branch": "master", "commit": "c261509e78fc8dc55ad1fcf3cd7cdde49f35435c" },
|
||||
"vim-eunuch": { "branch": "master", "commit": "8fb3904be27b6b60d086f87c2570085902414069" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
|
||||
"vim-projectionist": { "branch": "master", "commit": "3736bd4a5f23b30821cbb892385bb1f1b0088cfc" },
|
||||
"vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" },
|
||||
"vim-rake": { "branch": "master", "commit": "af4ee966f5479fa89e60be067b6183f6addf9e4e" },
|
||||
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" },
|
||||
"vim-ruby": { "branch": "master", "commit": "f06f069ce67bdda6f2cd408f8859cdf031e5b6b4" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"vim-test": { "branch": "master", "commit": "c090bfd93919888bb0b86e1ab707bc6a3095097f" },
|
||||
"vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" }
|
||||
}
|
||||
16
dot_config/nvim/lua/config/filetypes.lua
Normal file
16
dot_config/nvim/lua/config/filetypes.lua
Normal file
@ -0,0 +1,16 @@
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
pom = "ruby",
|
||||
},
|
||||
filename = {
|
||||
["Jenkinsfile"] = "groovy",
|
||||
},
|
||||
complex = {
|
||||
["*.zsh.local"] = "zsh",
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "eruby.yaml",
|
||||
command = "set filetype=yaml",
|
||||
})
|
||||
31
dot_config/nvim/lua/config/keymaps.lua
Normal file
31
dot_config/nvim/lua/config/keymaps.lua
Normal file
@ -0,0 +1,31 @@
|
||||
local keymap = vim.keymap.set
|
||||
|
||||
-- Space as leader
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Better pane navigation
|
||||
keymap("n", "<C-h>", "<C-w>h")
|
||||
keymap("n", "<C-j>", "<C-w>j")
|
||||
keymap("n", "<C-k>", "<C-w>k")
|
||||
keymap("n", "<C-l>", "<C-w>l")
|
||||
|
||||
-- Neotree
|
||||
keymap("n", "\\", ":Neotree toggle<CR>")
|
||||
keymap("n", "<C-\\>", ":Neotree reveal<CR>")
|
||||
|
||||
-- Telescope
|
||||
keymap("n", "<C-p>", ":Telescope find_files<CR>")
|
||||
keymap("n", "<C-s>", ":Telescope live_grep<CR>")
|
||||
keymap("n", "<C-b>", ":Telescope buffers<CR>")
|
||||
|
||||
-- Formatting
|
||||
keymap("n", "<leader>f", vim.lsp.buf.format, { desc = "Format buffer" })
|
||||
|
||||
-- TreeSJ
|
||||
keymap("n", "gs", ":TSJSplit<CR>", { desc = "Split code block" })
|
||||
keymap("n", "gj", ":TSJJoin<CR>", { desc = "Join code block" })
|
||||
keymap("n", "gm", ":TSJToggle<CR>", { desc = "Split or join code block" })
|
||||
|
||||
-- LSP
|
||||
require("config.keymaps.lsp")
|
||||
require("config.keymaps.test")
|
||||
49
dot_config/nvim/lua/config/keymaps/lsp.lua
Normal file
49
dot_config/nvim/lua/config/keymaps/lsp.lua
Normal file
@ -0,0 +1,49 @@
|
||||
local keymap = vim.keymap.set
|
||||
|
||||
keymap(
|
||||
"n",
|
||||
"<leader>e",
|
||||
vim.diagnostic.open_float,
|
||||
{ desc = "Show LSP diagnostic" }
|
||||
)
|
||||
keymap("n", "[d", vim.diagnostic.goto_prev)
|
||||
keymap("n", "]d", vim.diagnostic.goto_next)
|
||||
keymap(
|
||||
"n",
|
||||
"<leader>q",
|
||||
vim.diagnostic.setloclist,
|
||||
{ desc = "Show all LSP errors" }
|
||||
)
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
|
||||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
||||
vim.keymap.set("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts)
|
||||
vim.keymap.set("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workleader_folders()))
|
||||
end, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
7
dot_config/nvim/lua/config/keymaps/test.lua
Normal file
7
dot_config/nvim/lua/config/keymaps/test.lua
Normal file
@ -0,0 +1,7 @@
|
||||
local keymap = vim.keymap.set
|
||||
|
||||
keymap("n", "<Leader>t", ":TestFile<CR>")
|
||||
keymap("n", "<Leader>s", ":TestNearest<CR>")
|
||||
keymap("n", "<Leader>l", ":TestLast<CR>")
|
||||
keymap("n", "<Leader>a", ":TestSuite<CR>")
|
||||
keymap("n", "<Leader>gt", ":TestVisit<CR>")
|
||||
22
dot_config/nvim/lua/config/lazy.lua
Normal file
22
dot_config/nvim/lua/config/lazy.lua
Normal file
@ -0,0 +1,22 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
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)
|
||||
|
||||
-- Configure lazy.nvim
|
||||
require("lazy").setup("plugins", {
|
||||
install = { missing = true, colorscheme = { "onedark" } },
|
||||
checker = { enabled = true },
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>z", "<cmd>:Lazy<cr>", { desc = "Plugin Manager" })
|
||||
31
dot_config/nvim/lua/config/lsp.lua
Normal file
31
dot_config/nvim/lua/config/lsp.lua
Normal file
@ -0,0 +1,31 @@
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- Neovim doesn't support snippets out of the box, so we need to mutate the
|
||||
-- capabilities we send to the language server to let them know we want snippets.
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
-- Setup our autocompletion. These configuration options are the default ones
|
||||
-- copied out of the documentation.
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
-- For `vsnip` user.
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "vsnip" },
|
||||
},
|
||||
formatting = {
|
||||
format = require("lspkind").cmp_format({
|
||||
with_text = true,
|
||||
menu = {
|
||||
nvim_lsp = "[LSP]",
|
||||
},
|
||||
}),
|
||||
},
|
||||
})
|
||||
58
dot_config/nvim/lua/config/options.lua
Normal file
58
dot_config/nvim/lua/config/options.lua
Normal file
@ -0,0 +1,58 @@
|
||||
require("onedark").setup({
|
||||
style = "darker",
|
||||
transparent = not vim.g.neovide,
|
||||
})
|
||||
|
||||
require("onedark").load()
|
||||
|
||||
local indent = 2
|
||||
|
||||
vim.opt.updatetime = 100
|
||||
|
||||
-- Local project config
|
||||
vim.opt.exrc = true
|
||||
|
||||
-- Tabstops
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.shiftwidth = indent
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.tabstop = indent
|
||||
|
||||
-- Line numbers
|
||||
vim.opt.number = true
|
||||
|
||||
-- Line width
|
||||
local colorcolumns = {}
|
||||
|
||||
if vim.g.neovide then
|
||||
for i = 1, 40 do
|
||||
table.insert(colorcolumns, string.format("+%i", i))
|
||||
end
|
||||
end
|
||||
|
||||
vim.opt.textwidth = 80
|
||||
vim.opt.colorcolumn = table.concat(colorcolumns, ",")
|
||||
|
||||
-- Highlight trailing whitespace
|
||||
vim.opt.listchars = "tab:▸·,trail:·,nbsp:·"
|
||||
vim.opt.list = true
|
||||
|
||||
-- Open new split panes to the right and bottom, which feels more natural
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
|
||||
-- Add a space after comment characters
|
||||
vim.g.NERDSpaceDelims = 1
|
||||
|
||||
-- Tests
|
||||
vim.g["test#strategy"] = "toggleterm"
|
||||
|
||||
-- GUI Font
|
||||
vim.o.guifont = "BerkeleyMono Nerd Font:h14"
|
||||
|
||||
-- Neovide
|
||||
if vim.g.neovide then
|
||||
vim.g.neovide_cursor_animation_length = 0
|
||||
vim.g.neovide_scroll_animation_length = 0
|
||||
end
|
||||
7
dot_config/nvim/lua/config/plugins/ascii.lua
Normal file
7
dot_config/nvim/lua/config/plugins/ascii.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
"MaximilianLloyd/ascii.nvim",
|
||||
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
/Users/danbarber/dotfiles-local/config/nvim/lua/config/plugins/colorschemes/onedark.lua
|
||||
7
dot_config/nvim/lua/config/plugins/colortils.lua
Normal file
7
dot_config/nvim/lua/config/plugins/colortils.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
"danbee/colortils.nvim",
|
||||
cmd = "Colortils",
|
||||
config = function()
|
||||
require("colortils").setup()
|
||||
end,
|
||||
}
|
||||
28
dot_config/nvim/lua/config/plugins/dashboard.lua
Normal file
28
dot_config/nvim/lua/config/plugins/dashboard.lua
Normal file
@ -0,0 +1,28 @@
|
||||
return {
|
||||
"glepnir/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
require("dashboard").setup({
|
||||
theme = "hyper",
|
||||
config = {
|
||||
header = {
|
||||
[[ . . ]],
|
||||
[[ ';;,. ::' ]],
|
||||
[[ ,:::;,, :ccc, ]],
|
||||
[[,::c::,,,,. :cccc,]],
|
||||
[[,cccc:;;;;;. cllll,]],
|
||||
[[,cccc;.;;;;;, cllll;]],
|
||||
[[:cccc; .;;;;;;. coooo;]],
|
||||
[[;llll; ,:::::'loooo;]],
|
||||
[[;llll: ':::::loooo:]],
|
||||
[[:oooo: .::::llodd:]],
|
||||
[[.;ooo: ;cclooo:.]],
|
||||
[[ .;oc 'coo;. ]],
|
||||
[[ .' .,. ]],
|
||||
[[]],
|
||||
[[]],
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
4
dot_config/nvim/lua/config/plugins/filetype.lua
Normal file
4
dot_config/nvim/lua/config/plugins/filetype.lua
Normal file
@ -0,0 +1,4 @@
|
||||
return {
|
||||
"nathom/filetype.nvim",
|
||||
}
|
||||
|
||||
7
dot_config/nvim/lua/config/plugins/gitsigns.lua
Normal file
7
dot_config/nvim/lua/config/plugins/gitsigns.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
|
||||
config = function()
|
||||
require("gitsigns").setup()
|
||||
end,
|
||||
}
|
||||
7
dot_config/nvim/lua/config/plugins/guess-indent.lua
Normal file
7
dot_config/nvim/lua/config/plugins/guess-indent.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
"nmac427/guess-indent.nvim",
|
||||
|
||||
config = function()
|
||||
require("guess-indent").setup()
|
||||
end,
|
||||
}
|
||||
7
dot_config/nvim/lua/config/plugins/indent-blankline.lua
Normal file
7
dot_config/nvim/lua/config/plugins/indent-blankline.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
|
||||
config = function()
|
||||
require("ibl").setup()
|
||||
end,
|
||||
}
|
||||
1
dot_config/nvim/lua/config/plugins/lspconfig/css.lua
Normal file
1
dot_config/nvim/lua/config/plugins/lspconfig/css.lua
Normal file
@ -0,0 +1 @@
|
||||
require("lspconfig").stylelint_lsp.setup({})
|
||||
5
dot_config/nvim/lua/config/plugins/lspconfig/elixir.lua
Normal file
5
dot_config/nvim/lua/config/plugins/lspconfig/elixir.lua
Normal file
@ -0,0 +1,5 @@
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
require("lspconfig").elixirls.setup({
|
||||
cmd = { "elixir-ls" },
|
||||
})
|
||||
1
dot_config/nvim/lua/config/plugins/lspconfig/emmet.lua
Normal file
1
dot_config/nvim/lua/config/plugins/lspconfig/emmet.lua
Normal file
@ -0,0 +1 @@
|
||||
require("lspconfig").emmet_ls.setup({})
|
||||
13
dot_config/nvim/lua/config/plugins/lspconfig/init.lua
Normal file
13
dot_config/nvim/lua/config/plugins/lspconfig/init.lua
Normal file
@ -0,0 +1,13 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
|
||||
config = function()
|
||||
require("config.plugins.lspconfig.css")
|
||||
require("config.plugins.lspconfig.elixir")
|
||||
require("config.plugins.lspconfig.emmet")
|
||||
require("config.plugins.lspconfig.javascript")
|
||||
require("config.plugins.lspconfig.lua")
|
||||
require("config.plugins.lspconfig.ruby")
|
||||
require("config.plugins.lspconfig.rust")
|
||||
end,
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
lspconfig.eslint.setup({})
|
||||
lspconfig.ts_ls.setup({})
|
||||
18
dot_config/nvim/lua/config/plugins/lspconfig/lua.lua
Normal file
18
dot_config/nvim/lua/config/plugins/lspconfig/lua.lua
Normal file
@ -0,0 +1,18 @@
|
||||
require("lspconfig").lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
2
dot_config/nvim/lua/config/plugins/lspconfig/ruby.lua
Normal file
2
dot_config/nvim/lua/config/plugins/lspconfig/ruby.lua
Normal file
@ -0,0 +1,2 @@
|
||||
-- require("lspconfig").solargraph.setup({})
|
||||
require("lspconfig").standardrb.setup({})
|
||||
1
dot_config/nvim/lua/config/plugins/lspconfig/rust.lua
Normal file
1
dot_config/nvim/lua/config/plugins/lspconfig/rust.lua
Normal file
@ -0,0 +1 @@
|
||||
require("lspconfig").rust_analyzer.setup({})
|
||||
9
dot_config/nvim/lua/config/plugins/lualine.lua
Normal file
9
dot_config/nvim/lua/config/plugins/lualine.lua
Normal file
@ -0,0 +1,9 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
|
||||
config = function()
|
||||
require("lualine").setup()
|
||||
end,
|
||||
}
|
||||
7
dot_config/nvim/lua/config/plugins/mason.lua
Normal file
7
dot_config/nvim/lua/config/plugins/mason.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end,
|
||||
}
|
||||
18
dot_config/nvim/lua/config/plugins/neo-tree.lua
Normal file
18
dot_config/nvim/lua/config/plugins/neo-tree.lua
Normal file
@ -0,0 +1,18 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
|
||||
config = function()
|
||||
-- Unless you are still migrating, remove the deprecated commands from v1.x
|
||||
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
||||
|
||||
require("neo-tree").setup({
|
||||
hijack_netrw_behavior = "open_default",
|
||||
})
|
||||
end,
|
||||
}
|
||||
25
dot_config/nvim/lua/config/plugins/null-ls.lua
Normal file
25
dot_config/nvim/lua/config/plugins/null-ls.lua
Normal file
@ -0,0 +1,25 @@
|
||||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
dependencies = {
|
||||
"nvimtools/none-ls-extras.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.crystal_format,
|
||||
null_ls.builtins.formatting.stylelint,
|
||||
require("none-ls.formatting.standardrb"),
|
||||
require("none-ls.formatting.rustfmt"),
|
||||
null_ls.builtins.formatting.stylua,
|
||||
},
|
||||
})
|
||||
|
||||
-- Format on save
|
||||
-- vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
-- command = "lua vim.lsp.buf.format()",
|
||||
-- })
|
||||
end,
|
||||
}
|
||||
66
dot_config/nvim/lua/config/plugins/nvim-cmp.lua
Normal file
66
dot_config/nvim/lua/config/plugins/nvim-cmp.lua
Normal file
@ -0,0 +1,66 @@
|
||||
local has_words_before = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0
|
||||
and vim.api
|
||||
.nvim_buf_get_lines(0, line - 1, line, true)[1]
|
||||
:sub(col, col)
|
||||
:match("%s")
|
||||
== nil
|
||||
end
|
||||
|
||||
local feedkey = function(key, mode)
|
||||
vim.api.nvim_feedkeys(
|
||||
vim.api.nvim_replace_termcodes(key, true, true, true),
|
||||
mode,
|
||||
true
|
||||
)
|
||||
end
|
||||
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif vim.fn["vsnip#available"](1) == 1 then
|
||||
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function()
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
||||
feedkey("<Plug>(vsnip-jump-prev)", "")
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "vsnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
return {
|
||||
"brenoprata10/nvim-highlight-colors",
|
||||
config = function()
|
||||
require("nvim-highlight-colors").setup({
|
||||
enable_tailwind = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
13
dot_config/nvim/lua/config/plugins/nvim-test.lua
Normal file
13
dot_config/nvim/lua/config/plugins/nvim-test.lua
Normal file
@ -0,0 +1,13 @@
|
||||
return {
|
||||
"klen/nvim-test",
|
||||
|
||||
config = function()
|
||||
require("nvim-test").setup({
|
||||
term = "toggleterm",
|
||||
termOpts = {
|
||||
direction = "horizontal",
|
||||
height = 24,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
78
dot_config/nvim/lua/config/plugins/nvim-treesitter.lua
Normal file
78
dot_config/nvim/lua/config/plugins/nvim-treesitter.lua
Normal file
@ -0,0 +1,78 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
||||
build = ":TSUpdate",
|
||||
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
init = function()
|
||||
-- PERF: no need to load the plugin,
|
||||
-- if we only need its queries for mini.ai
|
||||
local plugin =
|
||||
require("lazy.core.config").spec.plugins["nvim-treesitter"]
|
||||
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
|
||||
local enabled = false
|
||||
|
||||
if opts.textobjects then
|
||||
for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do
|
||||
if opts.textobjects[mod] and opts.textobjects[mod].enable then
|
||||
enabled = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not enabled then
|
||||
require("lazy.core.loader").disable_rtp_plugin(
|
||||
"nvim-treesitter-textobjects"
|
||||
)
|
||||
end
|
||||
end,
|
||||
},
|
||||
"RRethy/nvim-treesitter-endwise",
|
||||
},
|
||||
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
highlight = { enable = true },
|
||||
endwise = { enable = true },
|
||||
auto_install = true,
|
||||
sync_install = false,
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"comment",
|
||||
"css",
|
||||
"eex",
|
||||
"elixir",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"luap",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"ruby",
|
||||
"rust",
|
||||
"scss",
|
||||
"sql",
|
||||
"swift",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vue",
|
||||
"yaml",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
1
dot_config/nvim/lua/config/plugins/symlink_conform.lua
Normal file
1
dot_config/nvim/lua/config/plugins/symlink_conform.lua
Normal file
@ -0,0 +1 @@
|
||||
/Users/db/dotfiles-local/config/nvim/lua/config/plugins/conform.lua
|
||||
1
dot_config/nvim/lua/config/plugins/symlink_onedark.lua
Normal file
1
dot_config/nvim/lua/config/plugins/symlink_onedark.lua
Normal file
@ -0,0 +1 @@
|
||||
/Users/danbarber/dotfiles-local/config/nvim/lua/config/plugins/onedark.lua
|
||||
5
dot_config/nvim/lua/config/plugins/telescope.lua
Normal file
5
dot_config/nvim/lua/config/plugins/telescope.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
}
|
||||
9
dot_config/nvim/lua/config/plugins/todo-comments.lua
Normal file
9
dot_config/nvim/lua/config/plugins/todo-comments.lua
Normal file
@ -0,0 +1,9 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
highlight = {
|
||||
comments_only = false
|
||||
}
|
||||
}
|
||||
}
|
||||
7
dot_config/nvim/lua/config/plugins/toggleterm.lua
Normal file
7
dot_config/nvim/lua/config/plugins/toggleterm.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
"akinsho/toggleterm.nvim",
|
||||
|
||||
version = "*",
|
||||
|
||||
config = true,
|
||||
}
|
||||
11
dot_config/nvim/lua/config/plugins/treesj.lua
Normal file
11
dot_config/nvim/lua/config/plugins/treesj.lua
Normal file
@ -0,0 +1,11 @@
|
||||
return {
|
||||
"Wansmer/treesj",
|
||||
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
|
||||
config = function()
|
||||
require("treesj").setup({
|
||||
use_default_keymaps = false,
|
||||
})
|
||||
end,
|
||||
}
|
||||
14
dot_config/nvim/lua/config/plugins/which-key.lua
Normal file
14
dot_config/nvim/lua/config/plugins/which-key.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
|
||||
config = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
|
||||
require("which-key").setup({
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
})
|
||||
end,
|
||||
}
|
||||
7
dot_config/nvim/lua/plugins/colorschemes.lua
Normal file
7
dot_config/nvim/lua/plugins/colorschemes.lua
Normal file
@ -0,0 +1,7 @@
|
||||
return {
|
||||
"navarasu/onedark.nvim",
|
||||
"folke/tokyonight.nvim",
|
||||
"rebelot/kanagawa.nvim",
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
"AlexvZyl/nordic.nvim",
|
||||
}
|
||||
41
dot_config/nvim/lua/plugins/init.lua
Normal file
41
dot_config/nvim/lua/plugins/init.lua
Normal file
@ -0,0 +1,41 @@
|
||||
return {
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-vsnip",
|
||||
"hrsh7th/vim-vsnip",
|
||||
"onsails/lspkind-nvim",
|
||||
"preservim/nerdcommenter",
|
||||
"tpope/vim-bundler",
|
||||
"tpope/vim-eunuch",
|
||||
"tpope/vim-fugitive",
|
||||
"tpope/vim-projectionist",
|
||||
"tpope/vim-rails",
|
||||
"tpope/vim-rake",
|
||||
"tpope/vim-repeat",
|
||||
"tpope/vim-rhubarb",
|
||||
"tpope/vim-surround",
|
||||
"vim-ruby/vim-ruby",
|
||||
"vim-test/vim-test",
|
||||
require("config.plugins.ascii"),
|
||||
require("config.plugins.colortils"),
|
||||
require("config.plugins.dashboard"),
|
||||
require("config.plugins.filetype"),
|
||||
require("config.plugins.guess-indent"),
|
||||
require("config.plugins.gitsigns"),
|
||||
require("config.plugins.indent-blankline"),
|
||||
require("config.plugins.lspconfig.init"),
|
||||
require("config.plugins.lualine"),
|
||||
require("config.plugins.mason"),
|
||||
require("config.plugins.neo-tree"),
|
||||
require("config.plugins.null-ls"),
|
||||
require("config.plugins.nvim-cmp"),
|
||||
require("config.plugins.nvim-highlight-colors"),
|
||||
require("config.plugins.nvim-treesitter"),
|
||||
require("config.plugins.telescope"),
|
||||
require("config.plugins.todo-comments"),
|
||||
require("config.plugins.toggleterm"),
|
||||
require("config.plugins.treesj"),
|
||||
require("config.plugins.which-key"),
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user