mirror of
https://github.com/danbee/dotfiles-local
synced 2025-03-04 08:49:07 +00:00
Compare commits
9 Commits
ccb981bdda
...
9fb4f8a6bb
| Author | SHA1 | Date | |
|---|---|---|---|
| 9fb4f8a6bb | |||
|
|
fb3b28b777 | ||
|
|
da69a9eba7 | ||
|
|
1d10668cd6 | ||
|
|
7e3a2cf5e9 | ||
|
|
d9a16ecf09 | ||
|
|
8ccc95f84e | ||
|
|
eb8d759915 | ||
| 60809d53f3 |
@ -1,28 +1,32 @@
|
||||
{
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "8fcc934a52af96120fe26358985c10c035984b53" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "5af1bb7d722ef8a96658f01d6eb219c4cf746b32" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "53bfb95b1ed1d87f6a276abdd322b267be0b5adf" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "5c4037432f0ae2d0b75d3a7b7cfa3022d7054e4d" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "57cce98dfdb2f2dd05a0567d89811e6d0505e13b" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "c28a7427c3fb29322db136f0564ec58807b26747" },
|
||||
"mason.nvim": { "branch": "main", "commit": "b54d4e3171cc9735de915dbb97e987fb1f05dad9" },
|
||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "2b2f74828eeb02cf29d6b21aa32eedadadc94ca7" },
|
||||
"nordic.nvim": { "branch": "main", "commit": "fc7ea160bb441f9c0245c2719a3c7b8c22468178" },
|
||||
"nui.nvim": { "branch": "main", "commit": "1f43b13d133eb4b4f53a4485379d9afa58808389" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "5855128178fa78293acdfb5b4e41ef046779240b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "7d5af779acbc8a6ff9dfd7f2d39ae898fb67480f" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "c85d059c462ae7de0aa2a6ed0589f0b223e0e6a9" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "b55fe6175f0001347a433c9df358c8cbf8a4e90f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "0568104bf8d0c3ab16395433fcc5c1638efc25d4" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "dd640f6cfb0e370cfd3db389f04b172508848bd3" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "942fe5faef47b21241e970551eba407bc10d9547" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "1b0c88094548a62641ece1e668fa9a234e1c539e" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "e5edefd9976039f5352e0c900f35206770b33a2d" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "df149bccb19a02c5c2b9fa6ec0716f0c0487feb0" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "172d858162c4fdeca9cb2cab56eb4b8237af5df1" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "bb5cc9ef3bbb17541929b745f74551c900188099" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "84ffb80e452d95e2c46fa29a98ea11a240f7843e" },
|
||||
"mason.nvim": { "branch": "main", "commit": "057ac5ca159c83e302a55bd839a96ff1ea2396db" },
|
||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "8d485aab32da9b8841d4af977f992b82b14af469" },
|
||||
"nerdcommenter": { "branch": "master", "commit": "1fe9e1cfea9bb0dbc77174d776759ed67899ee50" },
|
||||
"nordic.nvim": { "branch": "main", "commit": "bd4cf4e4ca8b6a8b63e2e6e38d2112a59be45494" },
|
||||
"nui.nvim": { "branch": "main", "commit": "ecd9def93891b9260b15b5fcef542eaabf4145c9" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "33b853a3933eed3137cd055aac4e539e69832ad0" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "11102d3db12c7f8b35265ad0e17a21511e5b1e68" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "427378a03ffc1e1bc023275583a49b1993e524d0" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "b8a0791eb435efc790755883cad166a91a4fe864" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "8673926519ea61069f9c1366d1ad1949316d250e" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "4ec26d67d419c12a4abaea02f1b6c57b40c08d7e" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "d20f23c0d6810c8754737428771eef40bd1056a7" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "713d26b98583b160b50fb827adb751f768238ed3" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "c5df636ce62a8aab7565f35da143cfd672526302" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "e6651a79facf5cc2b7c554fdc19eb8a9fe89602c" },
|
||||
"vim-startify": { "branch": "master", "commit": "81e36c352a8deea54df5ec1e2f4348685569bed2" },
|
||||
"vim-vsnip": { "branch": "master", "commit": "7753ba9c10429c29d25abfd11b4c60b76718c438" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4b73390eec680b4c061ea175eb32c0ff3412271d" }
|
||||
"which-key.nvim": { "branch": "main", "commit": "4acffc92953a90a790603bfdab7c92319ab167b1" }
|
||||
}
|
||||
@ -19,4 +19,7 @@ keymap("n", "<C-s>", ":Telescope live_grep<CR>")
|
||||
keymap("n", "<C-b>", ":Telescope buffers<CR>")
|
||||
|
||||
-- Formatting
|
||||
keymap("n", "<leader>f", ":lua vim.lsp.buf.format()<CR>")
|
||||
keymap("n", "<leader>f", vim.lsp.buf.format, { desc = "Format buffer" })
|
||||
|
||||
-- LSP
|
||||
require("config.keymaps.lsp")
|
||||
|
||||
48
config/nvim/lua/config/keymaps/lsp.lua
Normal file
48
config/nvim/lua/config/keymaps/lsp.lua
Normal file
@ -0,0 +1,48 @@
|
||||
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,
|
||||
})
|
||||
@ -2,6 +2,8 @@ require("onedark").load()
|
||||
|
||||
local indent = 2
|
||||
|
||||
vim.opt.updatetime = 100
|
||||
|
||||
-- Tabstops
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.shiftwidth = indent
|
||||
@ -10,3 +12,11 @@ vim.opt.tabstop = indent
|
||||
|
||||
-- Line numbers
|
||||
vim.opt.number = true
|
||||
|
||||
-- Line width
|
||||
vim.opt.textwidth = 80
|
||||
vim.opt.colorcolumn = "+1"
|
||||
|
||||
-- Open new split panes to the right and bottom, which feels more natural
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
|
||||
@ -4,4 +4,5 @@ return function()
|
||||
require("config.plugins.lspconfig.javascript")
|
||||
require("config.plugins.lspconfig.lua")
|
||||
require("config.plugins.lspconfig.ruby")
|
||||
require("config.plugins.lspconfig.rust")
|
||||
end
|
||||
|
||||
1
config/nvim/lua/config/plugins/lspconfig/rust.lua
Normal file
1
config/nvim/lua/config/plugins/lspconfig/rust.lua
Normal file
@ -0,0 +1 @@
|
||||
require("lspconfig").rust_analyzer.setup({})
|
||||
2
config/nvim/lua/config/plugins/nerdcommenter.lua
Normal file
2
config/nvim/lua/config/plugins/nerdcommenter.lua
Normal file
@ -0,0 +1,2 @@
|
||||
-- Add a space after comment characters
|
||||
vim.g.NERDSpaceDelims = 1
|
||||
@ -4,8 +4,27 @@ return function()
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.crystal_format,
|
||||
null_ls.builtins.formatting.eslint,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.prettierd.with({
|
||||
filetypes = {
|
||||
"css",
|
||||
"graphql",
|
||||
"handlebars",
|
||||
"html",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"json",
|
||||
"jsonc",
|
||||
"less",
|
||||
"markdown",
|
||||
"markdown.mdx",
|
||||
"ruby",
|
||||
"scss",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
"yaml",
|
||||
},
|
||||
}),
|
||||
null_ls.builtins.formatting.rustfmt,
|
||||
null_ls.builtins.formatting.standardrb,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
return {
|
||||
return function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
context_commentstring = { enable = true, enable_autocmd = false },
|
||||
context_commentstring = { enable = true },
|
||||
auto_install = true,
|
||||
sync_install = false,
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
@ -9,7 +12,6 @@ return {
|
||||
"dockerfile",
|
||||
"eex",
|
||||
"elixir",
|
||||
"help",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
@ -33,4 +35,5 @@ return {
|
||||
"vue",
|
||||
"yaml",
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
@ -6,6 +6,14 @@ return {
|
||||
"hrsh7th/cmp-vsnip",
|
||||
"hrsh7th/vim-vsnip",
|
||||
"mhinz/vim-startify",
|
||||
"tpope/vim-fugitive",
|
||||
"preservim/nerdcommenter",
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("gitsigns").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
config = require("config.plugins.nvim-cmp"),
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
||||
build = ":TSUpdate",
|
||||
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
@ -30,9 +27,8 @@ return {
|
||||
end
|
||||
end,
|
||||
},
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
},
|
||||
|
||||
---@type TSConfig
|
||||
opts = require("config.plugins.tree-sitter"),
|
||||
config = require("config.plugins.tree-sitter"),
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user