From 0ae98568e89c7792b0433e5bb450c6706562eb71 Mon Sep 17 00:00:00 2001 From: foswret Date: Wed, 2 Jul 2025 11:16:43 -0500 Subject: first commit --- nvim/lua/plugins/init.lua | 7 ++++ nvim/lua/plugins/lsp.lua | 91 +++++++++++++++++++++++++++++++++++++++++++ nvim/lua/plugins/obsidian.lua | 43 ++++++++++++++++++++ nvim/lua/plugins/theme.lua | 3 ++ nvim/lua/plugins/tmux.lua | 18 +++++++++ 5 files changed, 162 insertions(+) create mode 100644 nvim/lua/plugins/init.lua create mode 100644 nvim/lua/plugins/lsp.lua create mode 100644 nvim/lua/plugins/obsidian.lua create mode 100644 nvim/lua/plugins/theme.lua create mode 100644 nvim/lua/plugins/tmux.lua (limited to 'nvim/lua/plugins') diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..71214e8 --- /dev/null +++ b/nvim/lua/plugins/init.lua @@ -0,0 +1,7 @@ +return { + "folke/neodev.nvim", + "folke/which-key.nvim", + { "folke/neoconf.nvim", cmd = "Neoconf" }, + "mbbill/undotree", +} + diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..40a205c --- /dev/null +++ b/nvim/lua/plugins/lsp.lua @@ -0,0 +1,91 @@ +return { + { + 'williamboman/mason.nvim', + lazy = false, + opts = {}, + }, + + -- Autocompletion + { + 'hrsh7th/nvim-cmp', + event = 'InsertEnter', + config = function() + local cmp = require('cmp') + + cmp.setup({ + sources = { + {name = 'nvim_lsp'}, + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + }), + snippet = { + expand = function(args) + vim.snippet.expand(args.body) + end, + }, + }) + end + }, + + -- LSP + { + 'neovim/nvim-lspconfig', + cmd = {'LspInfo', 'LspInstall', 'LspStart'}, + event = {'BufReadPre', 'BufNewFile'}, + dependencies = { + {'hrsh7th/cmp-nvim-lsp'}, + {'williamboman/mason.nvim'}, + {'williamboman/mason-lspconfig.nvim'}, + }, + init = function() + -- Reserve a space in the gutter + -- This will avoid an annoying layout shift in the screen + vim.opt.signcolumn = 'yes' + end, + config = function() + local lsp_defaults = require('lspconfig').util.default_config + + -- Add cmp_nvim_lsp capabilities settings to lspconfig + -- This should be executed before you configure any language server + lsp_defaults.capabilities = vim.tbl_deep_extend( + 'force', + lsp_defaults.capabilities, + require('cmp_nvim_lsp').default_capabilities() + ) + + -- LspAttach is where you enable features that only work + -- if there is a language server active in the file + vim.api.nvim_create_autocmd('LspAttach', { + desc = 'LSP actions', + callback = function(event) + local opts = {buffer = event.buf} + + vim.keymap.set('n', 'K', 'lua vim.lsp.buf.hover()', opts) + vim.keymap.set('n', 'gd', 'lua vim.lsp.buf.definition()', opts) + vim.keymap.set('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + vim.keymap.set('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + vim.keymap.set('n', 'go', 'lua vim.lsp.buf.type_definition()', opts) + vim.keymap.set('n', 'gr', 'lua vim.lsp.buf.references()', opts) + vim.keymap.set('n', 'gs', 'lua vim.lsp.buf.signature_help()', opts) + vim.keymap.set('n', '', 'lua vim.lsp.buf.rename()', opts) + vim.keymap.set({'n', 'x'}, '', 'lua vim.lsp.buf.format({async = true})', opts) + vim.keymap.set('n', '', 'lua vim.lsp.buf.code_action()', opts) + end, + }) + + require('mason-lspconfig').setup({ + ensure_installed = {}, + handlers = { + -- this first function is the "default handler" + -- it applies to every language server without a "custom handler" + function(server_name) + require('lspconfig')[server_name].setup({}) + end, + } + }) + end + } +} diff --git a/nvim/lua/plugins/obsidian.lua b/nvim/lua/plugins/obsidian.lua new file mode 100644 index 0000000..7b95d1e --- /dev/null +++ b/nvim/lua/plugins/obsidian.lua @@ -0,0 +1,43 @@ +return { + "epwalsh/obsidian.nvim", + version = "*", -- recommended, use latest release instead of latest commit + lazy = true, + ft = "markdown", + -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault: + -- event = { + -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'. + -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md" + -- -- refer to `:h file-pattern` for more examples + -- "BufReadPre path/to/my-vault/*.md", + -- "BufNewFile path/to/my-vault/*.md", + -- }, + dependencies = { + -- Required. + "nvim-lua/plenary.nvim", + + -- see below for full list of optional dependencies 👇 + }, + opts = { + workspaces = { + { + name = "zettelkasten", + path = "~/zettelkasten", + }, + }, + + note_frontmatter_func = function(note) + + local out = { aliases = note.aliases, tags = note.tags } + + -- `note.metadata` contains any manually added fields in the frontmatter. + -- So here we just make sure those fields are kept in the frontmatter. + if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then + for k, v in pairs(note.metadata) do + out[k] = v + end + end + + return out + end, + }, +} diff --git a/nvim/lua/plugins/theme.lua b/nvim/lua/plugins/theme.lua new file mode 100644 index 0000000..0f491cb --- /dev/null +++ b/nvim/lua/plugins/theme.lua @@ -0,0 +1,3 @@ +return { + 'kepano/flexoki-neovim', name = 'flexoki' +} diff --git a/nvim/lua/plugins/tmux.lua b/nvim/lua/plugins/tmux.lua new file mode 100644 index 0000000..31321a6 --- /dev/null +++ b/nvim/lua/plugins/tmux.lua @@ -0,0 +1,18 @@ +return { + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + "TmuxNavigatorProcessList", + }, + keys = { + { "", "TmuxNavigateLeft" }, + { "", "TmuxNavigateDown" }, + { "", "TmuxNavigateUp" }, + { "", "TmuxNavigateRight" }, + { "", "TmuxNavigatePrevious" }, + }, +} -- cgit v1.2.3