Initial commit
Dotfiles managed with GNU Stow: Hyprland (Lua config), Neovim, zsh, tmux, ghostty, alacritty, waybar, yazi, lazygit, herdr, Claude Code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
local set = vim.opt_local
|
||||
|
||||
set.shiftwidth = 2
|
||||
set.tabstop = 4
|
||||
set.softtabstop = 4
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Setting vim options for spesific languages. after/ftplugin/{lang}.lua
|
||||
local set = vim.opt_local
|
||||
|
||||
set.shiftwidth = 2
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
filetypes = { "html", "css", "javascript", "templ", "svelte" },
|
||||
init_options = {
|
||||
html = {
|
||||
options = {
|
||||
["bem.enabled"] = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
diagnostics = {
|
||||
disable = { 'require' },
|
||||
globals = {
|
||||
'vim',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
require("settings")
|
||||
require("mappings")
|
||||
require("autocommands")
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.uv.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)
|
||||
|
||||
require("lazy").setup({ { import = "plugins" }, { import = "plugins.dap" }, { import = "plugins.lsp" } }, {
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
|
||||
require("catppuccin").setup()
|
||||
vim.cmd.colorscheme("catppuccin")
|
||||
|
||||
require("avante_lib").load()
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" },
|
||||
"avante.nvim": { "branch": "main", "commit": "8a5a5c16a3c693bf7d9a8da1ee78269e8728879b" },
|
||||
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
||||
"catppuccin": { "branch": "main", "commit": "79e2049a0fdf7ec840f8463fe1d962c94493196b" },
|
||||
"conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||
"flutter-tools.nvim": { "branch": "main", "commit": "7d1acfd139215e02d2784733af69a61aaebe06e8" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"herdr-splits.nvim": { "branch": "main", "commit": "c58bfdf01520845583e0033c11c56fc9d21a5424" },
|
||||
"img-clip.nvim": { "branch": "main", "commit": "b6ddfb97b5600d99afe3452d707444afda658aca" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" },
|
||||
"leap.nvim": { "branch": "main", "commit": "57dff92b81db7ae32260d626f30dfcfb13d00d27" },
|
||||
"luvit-meta": { "branch": "main", "commit": "cc9b2d412d2fbd30b94a70cfc214c2a3be27a0a2" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "67029ccdac1ef8941e13b826417bc0ffac24cc86" },
|
||||
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "72a05f62c52241bc7441c820eb53946f92b2e6a4" },
|
||||
"nvim-dap": { "branch": "master", "commit": "9e848e09a697ee95302a3ef2dd43fd6eb709e570" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "1c0d8f70dbc8827263eedc3cf7021ceba0f68689" },
|
||||
"nvim-nio": { "branch": "master", "commit": "edcc181a875301dd21840189aa2f2f9ad69fc172" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "7b6cc8949f9999c5ed91436cbe24aa5f99c42025" },
|
||||
"nvim-treesitter-textobjects": { "branch": "main", "commit": "898ee307df58f854d11cd7edd06472574d48014e" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "2ae6958df7ced50baac5035cec0c15799eedfbf7" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "6d1d41da4873a445c5605f2005ad2c68c99d8770" },
|
||||
"vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" },
|
||||
"vim-dadbod-ui": { "branch": "master", "commit": "afd07819d8efcefc3317205b855ad4e3513b0011" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
-- Usercommand that executes a command and pastes the output to a buffer
|
||||
vim.api.nvim_create_user_command('Redir', function(ctx)
|
||||
local lines = vim.split(vim.api.nvim_exec2(ctx.args, { output = true }).output, '\n', { plain = true })
|
||||
vim.cmd('new')
|
||||
vim.api.nvim_buf_set_lines(0, 0, -1, false, lines)
|
||||
vim.opt_local.modified = false
|
||||
end, { nargs = '+', complete = 'command' })
|
||||
|
||||
-- -- Spellcheck for prose filetypes. spellfile.vim (built-in) auto-downloads missing dicts.
|
||||
-- vim.api.nvim_create_autocmd('FileType', {
|
||||
-- pattern = { 'markdown', 'gitcommit', 'text', 'tex', 'plaintex' },
|
||||
-- callback = function()
|
||||
-- vim.opt_local.spell = true
|
||||
-- vim.opt_local.spelllang = { 'en_us', 'en_gb', 'nb' }
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
-- [[ Highlight on yank ]]
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = '*',
|
||||
})
|
||||
|
||||
-- TODO: Move this to keymaps?
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
desc = 'LSP actions',
|
||||
callback = function()
|
||||
local bufmap = function(mode, lhs, rhs)
|
||||
local opts = { buffer = true }
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
|
||||
-- Displays hover information about the symbol under the cursor
|
||||
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
||||
|
||||
-- Jump to the definition
|
||||
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
||||
|
||||
-- Jump to declaration
|
||||
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
|
||||
|
||||
-- Lists all the implementations for the symbol under the cursor
|
||||
bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
|
||||
|
||||
-- Jumps to the definition of the type symbol
|
||||
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
|
||||
|
||||
-- Lists all the references
|
||||
bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
|
||||
|
||||
-- Displays a function's signature information
|
||||
bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
|
||||
|
||||
-- Renames all references to the symbol under the cursor
|
||||
bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
||||
|
||||
-- Selects a code action available at the current cursor position
|
||||
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
||||
|
||||
-- Show diagnostics in a floating window
|
||||
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
||||
|
||||
-- Move to the previous diagnostic
|
||||
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
||||
|
||||
-- Move to the next diagnostic
|
||||
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
||||
end
|
||||
})
|
||||
@@ -0,0 +1,44 @@
|
||||
-- Leader maps
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Keymaps for better default experience
|
||||
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
|
||||
|
||||
vim.keymap.set("n", "x", '"_x', { silent = true })
|
||||
|
||||
-- To source lua files.
|
||||
vim.keymap.set("n", "<leader><leader>x", "<cmd>source %<CR>")
|
||||
vim.keymap.set("n", "<leader>x", ":.lua<CR>")
|
||||
vim.keymap.set("v", "<leader>x", ":lua<CR>")
|
||||
|
||||
-- Move selected text
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
vim.keymap.set("x", "<leader>p", [["_dP]])
|
||||
|
||||
-- Move next line to end of current line
|
||||
vim.keymap.set("n", "J", "mzJ`z")
|
||||
-- Center the screen after jumping
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
vim.keymap.set("n", "<leader>e", vim.cmd.Ex, { desc = "Open netrw" })
|
||||
|
||||
-- Remap for dealing with word wrap
|
||||
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.jump, { desc = "Go to previous diagnostic message" })
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.jump, { desc = "Go to next diagnostic message" })
|
||||
vim.keymap.set("n", "<leader>r", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
|
||||
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
|
||||
|
||||
-- PLUGINS
|
||||
-- Leap
|
||||
vim.keymap.set({ 'n', 'x', 'o' }, 's', '<Plug>(leap)')
|
||||
vim.keymap.set('n', 'S', '<Plug>(leap-from-window)')
|
||||
@@ -0,0 +1,38 @@
|
||||
local config = 'plugins.avante_config'
|
||||
|
||||
return {
|
||||
"yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
lazy = false,
|
||||
version = false, -- set this if you want to always pull the latest change
|
||||
opts = config,
|
||||
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
|
||||
build = "make",
|
||||
dependencies = {
|
||||
"stevearc/dressing.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
--- The below dependencies are optional,
|
||||
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
|
||||
{
|
||||
-- support for image pasting
|
||||
"HakonHarnes/img-clip.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- recommended settings
|
||||
default = {
|
||||
embed_image_as_base64 = false,
|
||||
prompt_for_file_name = false,
|
||||
drag_and_drop = {
|
||||
insert_mode = true,
|
||||
},
|
||||
-- required for Windows users
|
||||
use_absolute_path = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
local Util = require('avante.utils')
|
||||
local M = {
|
||||
}
|
||||
|
||||
return M
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
return {
|
||||
'saghen/blink.cmp',
|
||||
dependencies = {
|
||||
'rafamadriz/friendly-snippets',
|
||||
{ 'L3MON4D3/LuaSnip', version = 'v2.*' },
|
||||
},
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '*',
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = 'default',
|
||||
},
|
||||
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
|
||||
signature = { enabled = true },
|
||||
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = false
|
||||
}
|
||||
},
|
||||
snippets = {
|
||||
preset = 'luasnip',
|
||||
},
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer', 'markdown' },
|
||||
providers = {
|
||||
markdown = { name = 'RenderMarkdown', module = 'render-markdown.integ.blink' },
|
||||
},
|
||||
},
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"catppuccin/nvim", name = "catppuccin", priority = 1000
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"catgoose/nvim-colorizer.lua",
|
||||
event = "BufReadPre",
|
||||
opts = { -- set to setup table
|
||||
user_default_options = {
|
||||
tailwind = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
return { -- Autoformat
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>mp",
|
||||
function()
|
||||
require("conform").format({ async = true, lsp_format = "fallback" })
|
||||
end,
|
||||
mode = "n",
|
||||
desc = "Format buffer",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
notify_on_error = true,
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||
-- have a well standardized coding style. You can add additional
|
||||
-- languages here or re-enable it for the disabled ones.
|
||||
local disable_filetypes = { c = true, cpp = true, html = true }
|
||||
local lsp_format_opt
|
||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||
lsp_format_opt = "never"
|
||||
else
|
||||
lsp_format_opt = "fallback"
|
||||
end
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_format = lsp_format_opt,
|
||||
}
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
html = { "prettierd" },
|
||||
css = { "prettierd" },
|
||||
javascript = { "prettierd" },
|
||||
templ = { "templ" },
|
||||
xml = { "xmlformatter" },
|
||||
json = { "prettierd" }
|
||||
},
|
||||
formatters = {
|
||||
templ = {
|
||||
command = "templ",
|
||||
args = { "fmt" },
|
||||
stdin = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"tpope/vim-dadbod",
|
||||
"kristijanhusak/vim-dadbod-completion",
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
return {
|
||||
{
|
||||
'rcarriga/nvim-dap-ui',
|
||||
dependencies = { 'mfussenegger/nvim-dap', 'nvim-neotest/nvim-nio' },
|
||||
config = function()
|
||||
local dap, dapui = require 'dap', require 'dapui'
|
||||
|
||||
vim.keymap.set('n', '<leader>du', function()
|
||||
dapui.toggle()
|
||||
end, { desc = 'Toggle DAP UI' })
|
||||
vim.keymap.set('n', '<leader>dr', function()
|
||||
dapui.toggle({ reset = true })
|
||||
end, { desc = 'Toggle DAP UI Reset' })
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
-- dap.listeners.before.event_exited.dapui_config = function()
|
||||
-- dapui.close()
|
||||
-- end
|
||||
dapui.setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
dependencies = { 'mfussenegger/nvim-dap' },
|
||||
config = function()
|
||||
require('nvim-dap-virtual-text').setup({})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
return {
|
||||
{ "mfussenegger/nvim-dap" },
|
||||
{
|
||||
"leoluz/nvim-dap-go",
|
||||
dependencies = { "mfussenegger/nvim-dap" },
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapgo = require("dap-go")
|
||||
|
||||
dapgo.setup({
|
||||
dap_configurations = {
|
||||
{
|
||||
type = "go",
|
||||
name = "Attach remote",
|
||||
mode = "remote",
|
||||
request = "attach",
|
||||
port = 2345,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<F5>", function()
|
||||
dap.continue()
|
||||
end, { desc = "Debugger Continue" })
|
||||
vim.keymap.set("n", "<F6>", function()
|
||||
dap.step_over()
|
||||
end, { desc = "Debugger Step Over" })
|
||||
vim.keymap.set("n", "<F7>", function()
|
||||
dap.step_into()
|
||||
end, { desc = "Debugger Step Into" })
|
||||
vim.keymap.set("n", "<F8>", function()
|
||||
dap.step_out()
|
||||
end, { desc = "Debugger Step Out" })
|
||||
vim.keymap.set("n", "<F9>", function()
|
||||
dap.close()
|
||||
end, { desc = "Debugger Stop" })
|
||||
vim.keymap.set("n", "<leader>db", dap.toggle_breakpoint, { desc = "Debugger Toggle Breakpoint" })
|
||||
vim.keymap.set("n", "<leader>dt", function()
|
||||
dapgo.debug_test()
|
||||
end, { desc = "Debugger Closest test" })
|
||||
vim.keymap.set("n", "<leader>dl", function()
|
||||
dapgo.debug_last()
|
||||
end, { desc = "Debugger Last" })
|
||||
end,
|
||||
},
|
||||
{ import = "plugins.dap.dap-ui" },
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
'nvim-flutter/flutter-tools.nvim',
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
config = true,
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
return {
|
||||
"lmilojevicc/herdr-splits.nvim",
|
||||
-- Only inside herdr panes; vim-tmux-navigator covers tmux sessions.
|
||||
-- Requires the herdr-side plugin: `herdr plugin install lmilojevicc/herdr-splits.nvim`
|
||||
-- plus the plugin_action keybinds in herdr's config.toml.
|
||||
cond = vim.env.HERDR_ENV == "1",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
keys = {
|
||||
-- stylua: ignore start
|
||||
{ "<C-h>", function() require("herdr-splits").move_cursor_left() end, desc = "Navigate left" },
|
||||
{ "<C-j>", function() require("herdr-splits").move_cursor_down() end, desc = "Navigate down" },
|
||||
{ "<C-k>", function() require("herdr-splits").move_cursor_up() end, desc = "Navigate up" },
|
||||
{ "<C-l>", function() require("herdr-splits").move_cursor_right() end, desc = "Navigate right" },
|
||||
{ "<M-h>", function() require("herdr-splits").resize_left() end, desc = "Resize left" },
|
||||
{ "<M-j>", function() require("herdr-splits").resize_down() end, desc = "Resize down" },
|
||||
{ "<M-k>", function() require("herdr-splits").resize_up() end, desc = "Resize up" },
|
||||
{ "<M-l>", function() require("herdr-splits").resize_right() end, desc = "Resize right" },
|
||||
-- stylua: ignore end
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
---@module "ibl"
|
||||
---@type ibl.config
|
||||
opts = {},
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'tpope/vim-fugitive',
|
||||
'tpope/vim-rhubarb',
|
||||
'tpope/vim-sleuth',
|
||||
{ 'folke/which-key.nvim', opts = {} },
|
||||
{ 'numToStr/Comment.nvim', opts = {} },
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"kdheepak/lazygit.nvim",
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
-- optional for floating window border decoration
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||
-- order to load the plugin when the command is run for the first time
|
||||
keys = {
|
||||
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
'https://codeberg.org/andyg/leap.nvim',
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
-- Based on this blog: https://vonheikemen.github.io/devlog/tools/setup-nvim-lspconfig-plus-nvim-cmp/
|
||||
return {
|
||||
{
|
||||
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||
-- used for completion, annotations and signatures of Neovim apis
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
dependencies = {
|
||||
{ "Bilal2453/luvit-meta", lazy = true },
|
||||
},
|
||||
opts = {
|
||||
library = {
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = "luvit-meta/library", words = { "vim%.uv" } },
|
||||
{ plugins = { "nvim-dap-ui" }, types = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
ensure_installed = { "lua_ls", "gopls", "emmet_ls", "svelte" },
|
||||
},
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
},
|
||||
-- {
|
||||
-- "neovim/nvim-lspconfig",
|
||||
-- dependencies = {
|
||||
-- { "williamboman/mason.nvim", config = true },
|
||||
-- "williamboman/mason-lspconfig.nvim",
|
||||
-- { "saghen/blink.cmp" },
|
||||
-- },
|
||||
-- config = function()
|
||||
-- local mason = require("mason")
|
||||
-- local mason_lspconfig = require("mason-lspconfig")
|
||||
--
|
||||
-- mason.setup({
|
||||
-- ui = {
|
||||
-- icons = {
|
||||
-- package_installed = "✓",
|
||||
-- package_pending = "➜",
|
||||
-- package_uninstalled = "✗",
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
--
|
||||
-- local servers = {
|
||||
-- -- htmx = {},
|
||||
-- emmet_ls = {
|
||||
-- filetypes = { "html", "css", "javascript", "templ" },
|
||||
-- init_options = {
|
||||
-- html = {
|
||||
-- options = {
|
||||
-- ["bem.enabled"] = true,
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
-- },
|
||||
-- cssls = {},
|
||||
-- ts_ls = {},
|
||||
-- bashls = {},
|
||||
-- gopls = {
|
||||
-- filetypes = { "go", "gomod", "gowork" },
|
||||
-- settings = {
|
||||
-- gopls = {
|
||||
-- hints = {
|
||||
-- assignVariableTypes = true,
|
||||
-- compositeLiteralFields = true,
|
||||
-- compositeLiteralTypes = true,
|
||||
-- constantValues = true,
|
||||
-- functionTypeParameters = true,
|
||||
-- parameterNames = true,
|
||||
-- rangeVariableTypes = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- lua_ls = {
|
||||
-- settings = {
|
||||
-- Lua = {
|
||||
-- completion = {
|
||||
-- callSnippet = "Replace",
|
||||
-- },
|
||||
-- diagnostics = {
|
||||
-- disable = { "missing-fields" },
|
||||
-- globals = { "vim" },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- templ = {},
|
||||
-- tailwindcss = {
|
||||
-- filetypes = { "templ" },
|
||||
-- settings = {
|
||||
-- tailwindcss = {
|
||||
-- includeLanguages = {
|
||||
-- templ = "html",
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- html = {
|
||||
-- filetypes = { "html" },
|
||||
-- init_options = {
|
||||
-- configurationSection = { "html", "css", "javascript" },
|
||||
-- embeddedLanguages = {
|
||||
-- css = true,
|
||||
-- javascript = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
--
|
||||
-- local ensure_installed = vim.tbl_keys(servers or {})
|
||||
--
|
||||
-- mason_lspconfig.setup({
|
||||
-- automatic_enable = true,
|
||||
-- ensure_installed = ensure_installed,
|
||||
-- automatic_installation = true,
|
||||
-- })
|
||||
--
|
||||
-- local lsp_capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- lsp_capabilities =
|
||||
-- vim.tbl_deep_extend("force", lsp_capabilities, require("blink.cmp").get_lsp_capabilities())
|
||||
--
|
||||
-- -- Set up all servers with their configurations
|
||||
-- local lspconfig = require("lspconfig")
|
||||
-- mason_lspconfig.setup_handlers({
|
||||
-- function(server_name)
|
||||
-- local opts = servers[server_name] or {}
|
||||
-- opts.capabilities = lsp_capabilities
|
||||
-- lspconfig[server_name].setup(opts)
|
||||
-- end,
|
||||
-- })
|
||||
-- end,
|
||||
-- },
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- follow latest release.
|
||||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
luasnip.filetype_extend("markdown", { "loremipsum" })
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
config = true
|
||||
-- use opts = {} for passing setup options
|
||||
-- this is equivalent to setup({}) function
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {
|
||||
file_types = { "markdown", "Avante" },
|
||||
ft = { "markdown", "Avante" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "master",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
path_display = { "truncate " },
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-p>"] = actions.move_selection_previous, -- move to prev result
|
||||
["<C-n>"] = actions.move_selection_next, -- move to next result
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
pcall(telescope.load_extension, "fzf")
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Fuzzy find files in cwd" })
|
||||
keymap.set("n", "<leader>fa", function()
|
||||
builtin.find_files { hidden = true, no_ignore = true }
|
||||
end,
|
||||
{ desc = "Fuzzy find all files in cwd" })
|
||||
keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Fuzzy find help tags" })
|
||||
keymap.set("n", "<leader>fk", builtin.keymaps, { desc = "Fuzzy find keymaps" })
|
||||
keymap.set("n", "<leader>fo", builtin.oldfiles, { desc = "Fuzzy find recent files" })
|
||||
keymap.set("n", "<leader>fs", builtin.live_grep, { desc = "Find string in cwd" })
|
||||
keymap.set("n", "<leader>fc", builtin.grep_string, { desc = "Find string under cursor in cwd" })
|
||||
keymap.set("n", "<leader>ft", "<cmd>TodoTelescope<cr>", { desc = "Fuzzy find Todo-comments" })
|
||||
keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Telescope Buffers" })
|
||||
keymap.set("n", "<leader>fd", builtin.diagnostics, { desc = "Fuzzy find diagnostics over open buffers." })
|
||||
-- keymap.set("n", "<leader>fl", builtin.find_files({ cwd = vim.api.nvim_list_runtime_paths()[1] }))
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {},
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
return {
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
branch = 'main',
|
||||
build = ':TSUpdate',
|
||||
lazy = false,
|
||||
config = function()
|
||||
local parsers = {
|
||||
'c', 'cpp', 'go', 'gotmpl', 'lua', 'python', 'rust',
|
||||
'javascript', 'typescript', 'tsx', 'vimdoc', 'vim', 'bash',
|
||||
'markdown', 'markdown_inline', 'query', 'json', 'yaml', 'toml', 'html', 'css',
|
||||
}
|
||||
require('nvim-treesitter').install(parsers)
|
||||
|
||||
local ft_map = {
|
||||
c = 'c', cpp = 'cpp', go = 'go', gotmpl = 'gotmpl', lua = 'lua',
|
||||
python = 'python', rust = 'rust', javascript = 'javascript',
|
||||
typescript = 'typescript', typescriptreact = 'tsx', help = 'vimdoc',
|
||||
vim = 'vim', sh = 'bash', bash = 'bash', markdown = 'markdown',
|
||||
query = 'query', json = 'json', yaml = 'yaml', toml = 'toml',
|
||||
html = 'html', css = 'css',
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = vim.tbl_keys(ft_map),
|
||||
callback = function(args)
|
||||
local lang = ft_map[vim.bo[args.buf].filetype]
|
||||
if not lang then return end
|
||||
pcall(vim.treesitter.start, args.buf, lang)
|
||||
vim.bo[args.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<c-space>', function()
|
||||
vim.cmd('normal! v')
|
||||
local node = vim.treesitter.get_node()
|
||||
if node then
|
||||
local r1, c1, r2, c2 = node:range()
|
||||
vim.api.nvim_win_set_cursor(0, { r1 + 1, c1 })
|
||||
vim.cmd('normal! v')
|
||||
vim.api.nvim_win_set_cursor(0, { r2 + 1, math.max(c2 - 1, 0) })
|
||||
end
|
||||
end, { desc = 'TS node select' })
|
||||
end,
|
||||
},
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
branch = 'main',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter' },
|
||||
event = 'VeryLazy',
|
||||
config = function()
|
||||
local select = require('nvim-treesitter-textobjects.select').select_textobject
|
||||
local move = require('nvim-treesitter-textobjects.move')
|
||||
local swap = require('nvim-treesitter-textobjects.swap')
|
||||
|
||||
local sel = {
|
||||
aa = '@parameter.outer', ia = '@parameter.inner',
|
||||
af = '@function.outer', ['if'] = '@function.inner',
|
||||
ac = '@class.outer', ic = '@class.inner',
|
||||
}
|
||||
for k, q in pairs(sel) do
|
||||
for _, m in ipairs({ 'x', 'o' }) do
|
||||
vim.keymap.set(m, k, function() select(q, 'textobjects') end, { desc = 'TS ' .. q })
|
||||
end
|
||||
end
|
||||
|
||||
local goto_map = {
|
||||
{ ']m', 'goto_next_start', '@function.outer' },
|
||||
{ ']]', 'goto_next_start', '@class.outer' },
|
||||
{ ']M', 'goto_next_end', '@function.outer' },
|
||||
{ '][', 'goto_next_end', '@class.outer' },
|
||||
{ '[m', 'goto_previous_start', '@function.outer' },
|
||||
{ '[[', 'goto_previous_start', '@class.outer' },
|
||||
{ '[M', 'goto_previous_end', '@function.outer' },
|
||||
{ '[]', 'goto_previous_end', '@class.outer' },
|
||||
}
|
||||
for _, m in ipairs(goto_map) do
|
||||
vim.keymap.set({ 'n', 'x', 'o' }, m[1], function() move[m[2]](m[3], 'textobjects') end, { desc = 'TS ' .. m[2] .. ' ' .. m[3] })
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<leader>a', function() swap.swap_next('@parameter.inner') end, { desc = 'TS swap next param' })
|
||||
vim.keymap.set('n', '<leader>A', function() swap.swap_previous('@parameter.inner') end, { desc = 'TS swap prev param' })
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
-- Owns <C-h/j/k/l> only inside tmux; herdr-splits.nvim owns them in herdr.
|
||||
return {
|
||||
"christoomey/vim-tmux-navigator",
|
||||
cond = vim.env.TMUX ~= nil and vim.env.TMUX ~= "",
|
||||
cmd = {
|
||||
"TmuxNavigateLeft",
|
||||
"TmuxNavigateDown",
|
||||
"TmuxNavigateUp",
|
||||
"TmuxNavigateRight",
|
||||
"TmuxNavigatePrevious",
|
||||
},
|
||||
init = function()
|
||||
vim.g.tmux_navigator_no_mappings = 1
|
||||
end,
|
||||
keys = {
|
||||
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
|
||||
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
|
||||
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
|
||||
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
|
||||
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
vim.opt.shell = "/bin/zsh"
|
||||
vim.g.mapleader = " "
|
||||
vim.o.hlsearch = false
|
||||
|
||||
vim.wo.number = true
|
||||
vim.wo.relativenumber = true
|
||||
vim.wo.signcolumn = "auto"
|
||||
|
||||
-- Enable mouse mode
|
||||
vim.o.mouse = "a"
|
||||
vim.o.tabstop = 4
|
||||
vim.o.softtabstop = 4
|
||||
vim.o.shiftwidth = 4
|
||||
vim.o.expandtab = true
|
||||
|
||||
vim.o.smartindent = true
|
||||
|
||||
-- Sync clipboard between OS and Neovim.
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
|
||||
-- Enable break indent
|
||||
vim.o.breakindent = false
|
||||
|
||||
vim.o.wrap = true
|
||||
-- Save undo history
|
||||
vim.o.undofile = true
|
||||
|
||||
-- Case-insensitive searching UNLESS \C or capital in search
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
vim.o.scrolloff = 8
|
||||
-- Decrease update time
|
||||
vim.o.updatetime = 250
|
||||
vim.o.timeoutlen = 300
|
||||
|
||||
-- Set completeopt to have a better completion experience
|
||||
vim.o.completeopt = "menuone,noselect"
|
||||
|
||||
vim.o.termguicolors = true
|
||||
@@ -0,0 +1,2 @@
|
||||
require('catppuccin').setup()
|
||||
vim.cmd.colorscheme "catppuccin"
|
||||
Reference in New Issue
Block a user