Compare commits

...

121 commits

Author SHA1 Message Date
Salar Rahmanian b535afb6d9 Merge pull request 'add swift and cleanup lsp' (#32) from cleanup-lsp-add-swift into main
Reviewed-on: #32
2024-11-09 10:44:08 -08:00
Salar Rahmanian 4f39c23dd7 add swift and cleanup lsp 2024-11-09 10:43:20 -08:00
Salar Rahmanian 902fbd939c Merge pull request 'smart splits correction' (#31) from smart-splits-correction into main
Reviewed-on: #31
2024-11-01 18:06:38 -07:00
Salar Rahmanian 70e5afac39 smart splits correction 2024-11-01 18:06:13 -07:00
Salar Rahmanian 94f3b169bb Merge pull request 'change smart split keys' (#30) from add-smart-splits into main
Reviewed-on: #30
2024-11-01 17:57:39 -07:00
Salar Rahmanian 9bae641b35 correct syntax 2024-11-01 17:56:44 -07:00
Salar Rahmanian c6c097057c change smart split keys 2024-11-01 17:48:29 -07:00
Salar Rahmanian 4aeab6127f Merge pull request 'add smart splits' (#29) from add-smart-splits into main
Reviewed-on: #29
2024-10-30 23:56:47 -07:00
Salar Rahmanian 68910abbe0 add smart splits 2024-10-30 23:56:08 -07:00
Salar Rahmanian 2b0701c8a0 remove pyright 2024-10-21 17:11:09 -07:00
Salar Rahmanian 2a385cac58 avante update 2024-10-20 20:33:58 -07:00
Salar Rahmanian 38aaf6cffc avante plugin related cleanup 2024-10-20 19:35:38 -07:00
Salar Rahmanian 0baf336e89 correction 2024-10-06 23:41:48 -07:00
Salar Rahmanian 93702f8d19 use expand 2024-10-06 23:35:50 -07:00
Salar Rahmanian ccfff580a3 correction 2024-10-06 23:31:09 -07:00
Salar Rahmanian fea59fd133 Merge pull request 'copilot-updates and other tweaks' (#28) from copilot-updates into main
Reviewed-on: #28
2024-10-06 23:04:13 -07:00
Salar Rahmanian 2776da83bb update tab size for lua and nix 2024-10-06 23:03:04 -07:00
Salar Rahmanian c182511558 treesitter and indent updates 2024-10-06 23:00:23 -07:00
Salar Rahmanian d184855eb2 remove ollama 2024-10-06 23:00:12 -07:00
Salar Rahmanian ffc2d4c13d replace gen.nvim with avante 2024-10-06 22:48:48 -07:00
Salar Rahmanian 9452693037 remove yank changes and disable smartindent 2024-09-23 19:09:12 -07:00
Salar Rahmanian 03bf0a72b1 yank highlight tweak 2024-09-23 18:34:30 -07:00
Salar Rahmanian 2630d96e0b improvements to yank 2024-09-23 18:15:26 -07:00
Salar Rahmanian 1949d31e98 set tab size for json files 2024-09-21 20:18:55 -07:00
Salar Rahmanian 96dad8d803 formatting improvements 2024-09-21 20:11:13 -07:00
Salar Rahmanian b25a90efbc Merge pull request 'remove mason' (#27) from remove-mason into main
Reviewed-on: #27
2024-09-07 11:12:35 -07:00
Salar Rahmanian 085806840e remove mason 2024-09-07 11:12:10 -07:00
Salar Rahmanian 754a8bb8a7 Merge pull request 'remove fish lsp' (#26) from updates-to-lsp-correction into main
Reviewed-on: #26
2024-09-07 10:11:27 -07:00
Salar Rahmanian e725608176 remove fish lsp 2024-09-07 10:11:07 -07:00
Salar Rahmanian dacac8186c Merge pull request 'lsp updates' (#25) from updates-to-lsp into main
Reviewed-on: #25
2024-09-07 10:05:08 -07:00
Salar Rahmanian b2957a1307 lsp updates 2024-09-07 10:04:14 -07:00
Salar Rahmanian f59b6eedae Merge pull request 'remove neoclip' (#24) from remove-neoclip into main
Reviewed-on: #24
2024-09-03 00:50:37 -07:00
Salar Rahmanian 852c41e2fd remove neoclip 2024-09-03 00:50:08 -07:00
Salar Rahmanian 410d1c14a3 Merge pull request 'neoclip update' (#23) from add-neoclip-2 into main
Reviewed-on: #23
2024-09-03 00:46:56 -07:00
Salar Rahmanian 4ad660ff6b neoclip update 2024-09-03 00:46:11 -07:00
Salar Rahmanian 1878ca5f5c Merge pull request 'neoclip corrections' (#22) from add-neoclip-2 into main
Reviewed-on: #22
2024-09-02 08:58:10 -07:00
Salar Rahmanian e032529ae2 neoclip corrections 2024-09-02 08:57:41 -07:00
Salar Rahmanian a2c83932c8 Merge pull request 'add neoclip and octo plugins' (#21) from add-neoclip into main
Reviewed-on: #21
2024-09-02 08:42:13 -07:00
Salar Rahmanian 2e34ee2c18 add neoclip and octo plugins 2024-09-02 08:41:33 -07:00
Salar Rahmanian f55f491c46 Merge pull request 'add neotest and overseer' (#20) from add-neotest-overseer into main
Reviewed-on: #20
2024-09-01 22:55:42 -07:00
Salar Rahmanian f0f0a04618 add neotest and overseer 2024-09-01 22:54:53 -07:00
Salar Rahmanian c160396483 Merge pull request 'correction to basedpyright settings' (#19) from use-basedpyright-2 into main
Reviewed-on: #19
2024-08-31 09:37:49 -07:00
Salar Rahmanian 00741a1f18 correction to basedpyright settings 2024-08-31 09:37:12 -07:00
Salar Rahmanian 6e87f6360a Merge pull request 'replace pyright with basedpyright' (#18) from use-basedpyright into main
Reviewed-on: #18
2024-08-31 09:14:09 -07:00
Salar Rahmanian 4dccd81452 replace pyright with basedpyright 2024-08-31 09:13:32 -07:00
Salar Rahmanian f49357f038 Merge pull request 'pyright config change' (#17) from pyright-tweaks into main
Reviewed-on: #17
2024-08-30 23:26:30 -07:00
Salar Rahmanian 889d7df0c7 pyright config change 2024-08-30 23:24:53 -07:00
Salar Rahmanian 0e57d13d1d Merge pull request 'disable treesitter indent and re-enable smartindent' (#16) from indention-changes-2 into main
Reviewed-on: #16
2024-08-25 21:29:12 -07:00
Salar Rahmanian 87a0613402 disable treesitter indent and re-enable smartindent 2024-08-25 21:28:54 -07:00
Salar Rahmanian b768459ccf Merge pull request 'disable smartindent' (#15) from indention-changes into main
Reviewed-on: #15
2024-08-25 21:25:19 -07:00
Salar Rahmanian 2c54ee721d disable smartindent 2024-08-25 21:24:24 -07:00
Salar Rahmanian 8d6d972b8e Merge pull request 'open neotree on the right' (#14) from neotree-open-right into main
Reviewed-on: #14
2024-08-18 10:43:43 -07:00
Salar Rahmanian 05da9e89e0 open neotree on the right 2024-08-18 10:43:00 -07:00
Salar Rahmanian e5cf7829a4 Merge pull request 'use ctrl-j to accept copilot' (#13) from copilot-setting-update-2 into main
Reviewed-on: #13
2024-08-16 18:52:46 -07:00
Salar Rahmanian 14ba336744 use ctrl-j to accept copilot 2024-08-16 18:52:27 -07:00
Salar Rahmanian d8983796e9 Merge pull request 'copilot setting update' (#12) from copilot-setting-update into main
Reviewed-on: #12
2024-08-16 18:44:05 -07:00
Salar Rahmanian 59359e9d5e copilot setting update 2024-08-16 18:38:27 -07:00
Salar Rahmanian 11c5aecb3a Merge pull request 'add vscode support' (#11) from add-vscode-support into main
Reviewed-on: #11
2024-08-07 08:20:39 -07:00
Salar Rahmanian 79193d44f7 add vscode support 2024-08-07 08:19:18 -07:00
Salar Rahmanian fed5967077 Merge pull request 'nix lsp update' (#10) from nix-updates into main
Reviewed-on: #10
2024-06-07 23:19:08 -07:00
Salar Rahmanian 1dce120f9b nix lsp update 2024-06-07 23:18:34 -07:00
Salar Rahmanian 71648bb0f8 Merge pull request 'make gen.nvim lazy' (#9) from gen-nvim-lazy into main
Reviewed-on: #9
2024-06-02 13:57:41 -07:00
Salar Rahmanian b1f111c8ed make gen.nvim lazy 2024-06-02 13:57:16 -07:00
Salar Rahmanian 069573696f Merge pull request 'correction to gen.nvim' (#8) from add-gen-nvim-2 into main
Reviewed-on: #8
2024-06-02 12:14:35 -07:00
Salar Rahmanian 0d0c2c4898 correction to gen.nvim 2024-06-02 12:13:46 -07:00
Salar Rahmanian 0f6d6b7e16 Merge pull request 'add gen.nvim' (#7) from add-gen-nvim into main
Reviewed-on: #7
2024-06-02 11:17:32 -07:00
Salar Rahmanian 21ebd90830 add gen.nvim 2024-06-02 11:16:46 -07:00
Salar Rahmanian d5b436ac78 Merge pull request 'treesitter updates' (#6) from update-treesitter into main
Reviewed-on: #6
2024-05-19 17:11:32 -07:00
Salar Rahmanian b3e023926a treesitter updates 2024-05-19 17:11:05 -07:00
Salar Rahmanian f875590278 Merge pull request 'remove unused plugins and run stylelua' (#5) from remove-unused-plugins into main
Reviewed-on: #5
2024-05-18 22:05:19 -07:00
Salar Rahmanian e321003bb8 remove unused plugins and run stylelua 2024-05-18 22:04:13 -07:00
Salar Rahmanian 12c5e919e8 Merge pull request 'update conform config to be able to toggle it on or off' (#4) from conform-update into main
Reviewed-on: #4
2024-03-30 21:49:11 -07:00
Salar Rahmanian 97b02badad update conform config to be able to toggle it on or off 2024-03-30 21:47:40 -07:00
Salar Rahmanian 20abfd7ad7 Merge pull request 'add rust lsp support and cleanup' (#3) from add-rust into main
Reviewed-on: #3
2024-03-23 09:44:45 -07:00
Salar Rahmanian 11315a02af add rust lsp support and cleanup 2024-03-23 09:42:10 -07:00
Salar Rahmanian 6f0048ce70 Merge pull request 'removed obisidian and added conform and todo comments' (#2) from remove-obsidian-and-add-new-plugins into main
Reviewed-on: #2
2024-03-09 10:18:14 -08:00
Salar Rahmanian f6da4d1530 removed obisidian and added conform and todo comments 2024-03-09 10:16:54 -08:00
Salar Rahmanian a58443e9e5 Merge pull request 'add img-clip plugin' (#1) from add-imgclip into main
Reviewed-on: #1
2024-02-17 15:45:53 -08:00
Salar Rahmanian b89b3e708b add img-clip plugin 2024-02-17 15:44:34 -08:00
Salar Rahmanian 49af022e9a remove JAVA_HOME setting in metals 2023-12-17 15:25:05 -08:00
Salar Rahmanian 127bb29002 update metals to use global executable 2023-12-17 15:17:14 -08:00
Salar Rahmanian 0c64477fde remap tab for copilot 2023-12-17 13:55:43 -08:00
Salar Rahmanian 023d479cad add copilot 2023-12-17 13:16:29 -08:00
Salar Rahmanian eb90680227 obsidian paths correction 2023-11-05 20:50:31 -08:00
Salar Rahmanian 30857126bc obsidian key map update 2023-11-05 20:36:00 -08:00
Salar Rahmanian d1f3552a6b better neorg key mappings 2023-11-05 20:26:08 -08:00
Salar Rahmanian bfe51501c0 obsidian config correction 2023-11-05 15:09:24 -08:00
Salar Rahmanian a2a4948626 obsidian plugin updates 2023-11-05 14:58:59 -08:00
Salar Rahmanian c740bd0b9a add obsidian.nvim 2023-11-05 10:05:31 -08:00
Salar Rahmanian 543a87b647 update lsp servers 2023-10-20 22:44:25 -07:00
Salar Rahmanian ed9cdefbfe neorg: remove calendar module 2023-10-17 08:03:21 -07:00
Salar Rahmanian adab4c9868 neorg correction 2023-10-17 07:58:27 -07:00
Salar Rahmanian ac7708c702 correction to neorg concealer 2023-10-17 07:53:32 -07:00
Salar Rahmanian 8afb4ac78d neorg config improvements. Remove mind. 2023-10-17 07:45:29 -07:00
Salar Rahmanian 9de4e06a7d add neorg 2023-10-16 21:39:14 -07:00
Salar Rahmanian b25ff7fe59 remove help as parser 2023-10-11 14:55:50 -07:00
Salar Rahmanian c2d6d6379d switch back to dark theme 2023-10-06 22:11:34 -07:00
Salar Rahmanian c66027a361 add gruvbox theme 2023-10-06 15:06:23 -07:00
Salar Rahmanian 980db5dbf8 more updates to indentline config 2023-10-06 07:55:10 -07:00
Salar Rahmanian e70fbda549 indent plugin update 2023-10-06 07:50:03 -07:00
Salar Rahmanian 38cb2ecab7 Plugin updates 2023-10-06 07:40:33 -07:00
Salar Rahmanian bc2b71fa94 make metals not lazy 2023-05-27 22:14:12 -07:00
Salar Rahmanian 3c5cdb2304 correct mind data paths 2023-03-06 18:31:23 -08:00
Salar Rahmanian b873a14c3a nvim config update 2023-03-01 21:52:13 -08:00
Salar Rahmanian 8f9763738d terminal escape mapping 2023-02-28 19:00:36 -08:00
Salar Rahmanian a07069f030 lua lsp rename 2023-02-28 18:48:33 -08:00
Salar Rahmanian e7dfc75b15 add undo dependency 2023-02-28 18:19:20 -08:00
Salar Rahmanian e2ac81a656 undo keymap correction 2023-02-28 18:14:01 -08:00
Salar Rahmanian 5dc56d22aa add telescope-undo 2023-02-28 17:59:05 -08:00
Salar Rahmanian ff03b6eaaf linting 2023-02-24 19:12:24 -08:00
Salar Rahmanian 8b3d267492 fix composer 2023-02-24 19:09:30 -08:00
Salar Rahmanian 3ae37019b1 markdown improvements and lazy config changes 2023-02-24 18:56:36 -08:00
Salar Rahmanian f1ca602f8d markdown improvements 2023-02-24 18:14:38 -08:00
Salar Rahmanian e745fc4ec9 add glow 2023-02-24 00:18:12 -08:00
Salar Rahmanian a8853c25bb add key bindings for mind 2023-02-23 17:55:09 -08:00
Salar Rahmanian 30228420ad update neotree setting to show hidden files 2023-02-21 18:02:37 -08:00
Salar Rahmanian 62974959b4 lint 2023-02-11 15:30:04 -08:00
Salar Rahmanian 9431d011d1 add persistence locations for mind.nvim 2023-02-11 14:23:51 -08:00
Salar Rahmanian 89193f43b4 metals improvements 2 2023-02-11 13:59:53 -08:00
Salar Rahmanian 7b6176d6d7 metals improvements 2023-02-11 11:59:44 -08:00
Salar Rahmanian 7ad9b5a141 Merge pull request 'add-mind & metals telescope support' (#5) from add-mind into main
Reviewed-on: https://git.softinio.com/softinio/nvim-config/pulls/5
2023-02-11 19:36:16 +00:00
20 changed files with 547 additions and 161 deletions

194
init.lua
View file

@ -1,86 +1,112 @@
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,
if vim.g.vscode then
-- VSCode Neovim
require("user.vscode_keymaps")
else
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)
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
require("lazy").setup("plugins", {
lockfile = vim.fn.stdpath("data") .. "/lazy-lock.json", -- in data directory as normal location read only as managed by nix
dev = {
path = "~/Projects/Neovim",
},
})
-- [[ Setting options ]]
-- See `:help vim.o`
-- Set highlight on search
vim.o.hlsearch = true
vim.o.incsearch = true
-- clipboard
vim.o.clipboard = "unnamedplus"
-- Make line numbers default
vim.wo.number = true
-- Enable mouse mode
vim.o.mouse = "a"
-- Enable break indent
vim.o.breakindent = true
-- smart indenting
vim.o.smartindent = 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
-- Decrease update time
vim.o.updatetime = 250
vim.wo.signcolumn = "yes"
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Set completeopt to have a better completion experience
vim.o.completeopt = "menuone,noselect"
-- [[ Basic Keymaps ]]
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
-- 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 })
-- [[ 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 = "*",
})
-- sets the tab size for json files
vim.api.nvim_create_autocmd("FileType", {
pattern = { "json", "lua", "nix" },
callback = function()
vim.bo.tabstop = 2
vim.bo.shiftwidth = 2
vim.bo.expandtab = true
end,
})
-- Terminal Escape Key Mapping
vim.keymap.set("t", "<Esc>", [[<C-\><C-n>]])
-- Diagnostic keymaps
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float)
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist)
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
end
vim.opt.rtp:prepend(lazypath)
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
require("lazy").setup("plugins")
-- [[ Setting options ]]
-- See `:help vim.o`
-- Set highlight on search
vim.o.hlsearch = false
vim.o.incsearch = true
-- clipboard
vim.o.clipboard = "unnamedplus"
-- Make line numbers default
vim.wo.number = true
-- Enable mouse mode
vim.o.mouse = "a"
-- Enable break indent
vim.o.breakindent = 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
-- Decrease update time
vim.o.updatetime = 250
vim.wo.signcolumn = "yes"
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Set completeopt to have a better completion experience
vim.o.completeopt = "menuone,noselect"
-- [[ Basic Keymaps ]]
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
-- 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 })
-- [[ 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 = "*",
})
-- Diagnostic keymaps
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float)
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist)
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

23
lua/plugins/avante.lua Normal file
View file

@ -0,0 +1,23 @@
return {
"yetone/avante.nvim",
event = "VeryLazy",
lazy = false,
version = false,
opts = {
provider = "openai",
openai = {
api_key_name = "cmd:cat " .. vim.fn.expand("~/.openai"),
},
},
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
build = "make",
dependencies = {
"HakonHarnes/img-clip.nvim",
"MeanderingProgrammer/render-markdown.nvim",
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"nvim-treesitter/nvim-treesitter",
"stevearc/dressing.nvim",
},
}

46
lua/plugins/conform.lua Normal file
View file

@ -0,0 +1,46 @@
return {
"stevearc/conform.nvim",
config = function()
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
nix = { "nixfmt" },
python = function(bufnr)
if require("conform").get_formatter_info("ruff_format", bufnr).available then
return { "ruff_fix", "ruff_format" }
else
return { "isort", "black", "flake8" }
end
end,
scala = { "scalafmt" },
swift = { "swift_format" },
["*"] = { "trim_whitespace", "trim_newlines" },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return { timeout_ms = 500, lsp_fallback = true }
end,
})
vim.api.nvim_create_user_command("FormatDisable", function(args)
if args.bang then
-- FormatDisable! will disable formatting just for this buffer
vim.b.disable_autoformat = true
else
vim.g.disable_autoformat = true
end
end, {
desc = "Disable autoformat-on-save",
bang = true,
})
vim.api.nvim_create_user_command("FormatEnable", function()
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false
end, {
desc = "Re-enable autoformat-on-save",
})
end,
}

14
lua/plugins/copilot.lua Normal file
View file

@ -0,0 +1,14 @@
return {
"github/copilot.vim",
lazy = false,
config = function()
vim.api.nvim_set_keymap(
"i",
"<C-J>",
'copilot#Accept("\\<CR>")',
{ silent = true, script = true, expr = true, replace_keycodes = false }
)
vim.g.copilot_no_tab_map = true
vim.g.copilot_assume_mapped = true
end,
}

18
lua/plugins/img-clip.lua Normal file
View file

@ -0,0 +1,18 @@
return {
"HakonHarnes/img-clip.nvim",
event = "BufEnter",
opts = {
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
use_absolute_path = true,
},
},
keys = {
-- suggested keymap
{ "<leader>p", "<cmd>PasteImage<cr>", desc = "Paste clipboard image" },
},
}

View file

@ -27,6 +27,8 @@ return {
{ "folke/which-key.nvim", lazy = false },
{
"j-hui/fidget.nvim",
tag = "legacy",
event = "LspAttach",
config = function()
require("fidget").setup()
end,
@ -44,20 +46,12 @@ return {
"softinio/scaladex.nvim",
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
config = function()
require("indent_blankline").setup({
char = "",
show_trailing_blankline_indent = false,
require("ibl").setup({
indent = { char = "" },
})
end,
},
"tpope/vim-fugitive",
"tpope/vim-rhubarb",
"tpope/vim-sleuth",
{
"numToStr/Comment.nvim",
config = function()
require("Comment").setup()
end,
},
"SidOfc/mkdx",
}

View file

@ -1,25 +1,22 @@
return {
"neovim/nvim-lspconfig",
dependencies = {
-- Automatically install LSPs to stdpath for neovim
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
-- Useful status updates for LSP
"j-hui/fidget.nvim",
-- Additional lua configuration, makes nvim stuff amazing
"folke/neodev.nvim",
-- schemas for json and yaml files
"b0o/schemastore.nvim",
},
config = function()
-- LSP settings.
-- Require the lspconfig module
local lspconfig = require("lspconfig")
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
-- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself
-- many times.
--
-- In this case, we create a function that lets us more easily define mappings specific
-- We create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
local nmap = function(keys, func, desc)
if desc then
@ -57,49 +54,77 @@ return {
end, { desc = "Format current buffer with LSP" })
end
-- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. They will be passed to
-- the `settings` field of the server config. You must look up that documentation yourself.
local servers = {
-- clangd = {},
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
-- tsserver = {},
sumneko_lua = {
basedpyright = {
analysis = {
autoImportCompletions = true,
autoSearchPaths = true,
diagnosticMode = "openFilesOnly",
reportMissingImports = true,
reportMissingParameterType = true,
reportUnnecessaryComparison = true,
reportUnnecessaryContains = true,
reportUnusedClass = true,
reportUnusedFunction = true,
reportUnsedImports = true,
reportUnsusedVariables = true,
typeCheckingMode = "all",
useLibraryCodeForTypes = true,
},
},
bashls = {
bashIde = {
globPattern = "*@(.sh|.inc|.bash|.command)",
},
},
html = {},
jqls = {},
jsonls = {
json = {
format = {
enable = true,
},
schemas = require("schemastore").json.schemas(),
validate = true,
},
},
lua_ls = {
Lua = {
diagnostics = { globals = { "vim" } },
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
marksman = {},
nil_ls = {},
nixd = {},
rust_analyzer = {
diagnostics = {
enable = true,
},
},
sourcekit = {
workspace = {
didChangeConfiguration = {
dynamicRegistration = true,
},
},
},
ts_ls = {},
yamlls = {},
}
--
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
-- Setup mason so it can manage external tooling
require("mason").setup()
-- Ensure the servers above are installed
local mason_lspconfig = require("mason-lspconfig")
mason_lspconfig.setup({
ensure_installed = vim.tbl_keys(servers),
})
mason_lspconfig.setup_handlers({
function(server_name)
require("lspconfig")[server_name].setup({
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
})
end,
})
-- Iterate over the servers table and configure each one
for server, config in pairs(servers) do
-- Set up the server using the `config` if provided, otherwise just `on_attach` and `capabilities`
lspconfig[server].setup({
on_attach = on_attach,
capabilities = capabilities,
settings = config, -- Pass the specific server settings here
})
end
end,
}

View file

@ -2,13 +2,47 @@ return {
"nvim-lualine/lualine.nvim",
lazy = false,
config = function()
-- Default from its README then customized
-- Added metals status
require("lualine").setup({
options = {
icons_enabled = false,
theme = "tokyonight",
component_separators = "|",
section_separators = "",
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "g:metals_status", "encoding", "fileformat", "filetype", "overseer" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
})
end,
}

View file

@ -0,0 +1,4 @@
return {
"euclio/vim-markdown-composer",
build = "cargo build --release",
}

View file

@ -1,7 +0,0 @@
return {
"phaazon/mind.nvim",
branch = "v2.2",
config = function()
require("mind").setup()
end,
}

View file

@ -10,6 +10,17 @@ return {
{ "<leader>m", "<cmd>Neotree toggle<cr>", desc = "NeoTree" },
},
config = function()
require("neo-tree").setup()
require("neo-tree").setup({
window = {
position = "right",
},
filesystem = {
filtered_items = {
visible = true,
hide_dotfiles = false,
hide_gitignored = true,
},
},
})
end,
}

38
lua/plugins/neotest.lua Normal file
View file

@ -0,0 +1,38 @@
return {
"nvim-neotest/neotest",
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-neotest/neotest-python",
"stevanmilic/neotest-scala",
},
keys = {
{ "<leader>na", "<cmd>lua require('neotest').run.attach()<cr>", desc = "Attach to the nearest test" },
{ "<leader>nl", "<cmd>lua require('neotest').run.run_last()<cr>", desc = "Toggle Test Summary" },
{ "<leader>no", "<cmd>lua require('neotest').output_panel.toggle()<cr>", desc = "Toggle Test Output Panel" },
{ "<leader>np", "<cmd>lua require('neotest').run.stop()<cr>", desc = "Stop the nearest test" },
{ "<leader>ns", "<cmd>lua require('neotest').summary.toggle()<cr>", desc = "Toggle Test Summary" },
{ "<leader>nt", "<cmd>lua require('neotest').run.run()<cr>", desc = "Run the nearest test" },
{
"<leader>nT",
"<cmd>lua require('neotest').run.run(vim.fn.expand('%'))<cr>",
desc = "Run test the current file",
},
},
opts = {
adapters = {
["neotest-python"] = {
runner = "pytest",
args = { "-vvv" },
python = ".venv/bin/python",
},
["neotest-scala"] = {
runner = "sbt",
command = "test",
framework = "munit",
},
},
},
}

View file

@ -1,5 +1,6 @@
return {
"scalameta/nvim-metals",
lazy = false,
keys = {
{ "<leader>ws", "<cmd>lua require'metals'.hover_worksheet()<cr>", desc = "Metals Worksheet" },
{
@ -10,12 +11,32 @@ return {
},
config = function()
local metals_config = require("metals").bare_config()
metals_config.tvp = {
icons = {
enabled = true,
},
}
metals_config.settings = {
serverVersion = "latest.snapshot",
useGlobalExecutable = true,
showImplicitArguments = true,
showImplicitConversionsAndClasses = true,
showInferredType = true,
bloopSbtAlreadyInstalled = true,
excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" },
-- fallbackScalaVersion = "2.13.8",
superMethodLensesEnabled = true,
}
metals_config.on_attach = function(client, bufnr)
vim.keymap.set("n", "<leader>tt", require("metals.tvp").toggle_tree_view)
vim.keymap.set("n", "<leader>tr", require("metals.tvp").reveal_in_tree)
vim.cmd([[autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()]])
vim.cmd([[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]])
vim.cmd([[autocmd BufEnter,CursorHold,InsertLeave <buffer> lua vim.lsp.codelens.refresh()]])
end
metals_config.init_options.statusBarProvider = "on"
metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()

25
lua/plugins/octo.lua Normal file
View file

@ -0,0 +1,25 @@
return {
"pwntester/octo.nvim",
cmd = "Octo",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons",
},
config = function()
require("octo").setup({
enable_builtin = true,
file_panel = { use_icons = true },
mappings = {
review_diff = {
select_next_entry = { lhs = "<Tab>", desc = "move to previous changed file" },
select_prev_entry = { lhs = "<S-Tab>", desc = "move to next changed file" },
},
},
})
vim.treesitter.language.register("markdown", "octo")
end,
keys = {
{ "<leader>o", "<cmd>Octo<cr>", desc = "Octo" },
},
}

View file

@ -0,0 +1,11 @@
return {
"MeanderingProgrammer/render-markdown.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {
file_types = { "markdown", "Avante" },
render_modes = true,
},
ft = { "markdown", "Avante" },
}

View file

@ -0,0 +1,26 @@
return {
"mrjones2014/smart-splits.nvim",
lazy = false,
keys = {
-- resizing splits
{ "<A-a>", ":lua require('smart-splits').resize_left()<CR>", desc = "smart split: resize left" },
{ "<A-o>", ":lua require('smart-splits').resize_down()<CR>", desc = "smart split: resize down" },
{ "<A-e>", ":lua require('smart-splits').resize_up()<CR>", desc = "smart split: resize up" },
{ "<A-u>", ":lua require('smart-splits').resize_right()<CR>", desc = "smart split: resize right" },
-- moving between splits
{ "<C-a>", ":lua require('smart-splits').move_cursor_left()<CR>", desc = "smart split: move cursor left" },
{ "<C-o>", ":lua require('smart-splits').move_cursor_down()<CR>", desc = "smart split: move cursor up" },
{ "<C-e>", ":lua require('smart-splits').move_cursor_up()<CR>", desc = "smart split: move cursor up" },
{ "<C-u>", ":lua require('smart-splits').move_cursor_right()<CR>", desc = "smart split: move cursor right" },
{
"<C-\\>",
":lua require('smart-splits').move_cursor_previous()<CR>",
desc = "smart split: move cursor to previous",
},
-- swapping buffers between windows
{ "<leader><leader>a", ":lua require('smart-splits').swap_buf_left()<CR>", desc = "smart split: swap left" },
{ "<leader><leader>o", ":lua require('smart-splits').swap_buf_down()<CR>", desc = "smart split: swap down" },
{ "<leader><leader>e", ":lua require('smart-splits').swap_buf_up()<CR>", desc = "smart split: swap up" },
{ "<leader><leader>u", ":lua require('smart-splits').swap_buf_right()<CR>", desc = "smart split: swap right" },
},
}

View file

@ -4,6 +4,8 @@ return {
dependencies = {
"nvim-lua/plenary.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"debugloop/telescope-undo.nvim",
"nvim-telescope/telescope-ui-select.nvim",
},
config = function()
require("telescope").setup({
@ -20,6 +22,8 @@ return {
-- Enable telescope fzf native, if installed
pcall(require("telescope").load_extension, "fzf")
pcall(require("telescope").load_extension, "scaladex")
pcall(require("telescope").load_extension, "ui-select")
pcall(require("telescope").load_extension, "undo")
-- See `:help telescope.builtin`
vim.keymap.set("n", "<leader>?", require("telescope.builtin").oldfiles, { desc = "[?] Find recently opened files" })
@ -37,5 +41,6 @@ return {
vim.keymap.set("n", "<leader>sw", require("telescope.builtin").grep_string, { desc = "[S]earch current [W]ord" })
vim.keymap.set("n", "<leader>sg", require("telescope.builtin").live_grep, { desc = "[S]earch by [G]rep" })
vim.keymap.set("n", "<leader>sd", require("telescope.builtin").diagnostics, { desc = "[S]earch [D]iagnostics" })
vim.keymap.set("n", "<leader>su", "<cmd>Telescope undo<cr>", { desc = "[S]earch [U]ndo" })
end,
}

View file

@ -0,0 +1,12 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
keys = {
{ "<leader>t", "<cmd>TodoTelescope<cr>", desc = "To Do Comments" },
},
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
}

View file

@ -4,28 +4,28 @@ return {
-- build = function()
-- pcall(require("nvim-treesitter.install").update({ with_sync = true }))
-- end,
dependencies = { "nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/playground" },
dependencies = {
"nvim-treesitter/nvim-treesitter-context",
"nvim-treesitter/nvim-treesitter-refactor",
"nvim-treesitter/nvim-treesitter-textobjects",
"nvim-treesitter/playground",
},
config = function()
require("nvim-treesitter.configs").setup({
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = {
"awk",
"bash",
"c",
"cpp",
"go",
"lua",
"python",
"rust",
"typescript",
"help",
"vim",
"scala",
"bash",
"css",
"dockerfile",
"fish",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"go",
"haskell",
"hocon",
"html",
@ -34,12 +34,25 @@ return {
"javascript",
"json",
"json5",
"jsonc",
"latex",
"lua",
"make",
"markdown",
"markdown_inline",
"nix",
"proto",
"python",
"rust",
"scala",
"scss",
"sql",
"swift",
"terraform",
"toml",
"typescript",
"vim",
"xml",
"yaml",
},
@ -51,7 +64,13 @@ return {
auto_install = true,
highlight = { enable = true },
indent = { enable = true, disable = { "python" } },
indent = {
enable = true,
disable = {
"python",
"css",
},
},
incremental_selection = {
enable = true,
keymaps = {

View file

@ -0,0 +1,41 @@
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true }
-- remap leader key
keymap("n", "<Space>", "", opts)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- yank to system clipboard
keymap({ "n", "v" }, "<leader>y", '"+y', opts)
-- paste from system clipboard
keymap({ "n", "v" }, "<leader>p", '"+p', opts)
-- better indent handling
keymap("v", "<", "<gv", opts)
keymap("v", ">", ">gv", opts)
-- move text up and down
keymap("v", "J", ":m .+1<CR>==", opts)
keymap("v", "K", ":m .-2<CR>==", opts)
keymap("x", "J", ":move '>+1<CR>gv-gv", opts)
keymap("x", "K", ":move '<-2<CR>gv-gv", opts)
-- paste preserves primal yanked piece
keymap("v", "p", '"_dP', opts)
-- removes highlighting after escaping vim search
keymap("n", "<Esc>", "<Esc>:noh<CR>", opts)
-- call vscode commands from neovim
keymap({ "n", "v" }, "<leader>t", "<cmd>lua require('vscode').action('workbench.action.terminal.toggleTerminal')<CR>")
keymap({ "n", "v" }, "<leader>b", "<cmd>lua require('vscode').action('editor.debug.action.toggleBreakpoint')<CR>")
keymap({ "n", "v" }, "<leader>d", "<cmd>lua require('vscode').action('editor.action.showHover')<CR>")
keymap({ "n", "v" }, "<leader>a", "<cmd>lua require('vscode').action('editor.action.quickFix')<CR>")
keymap({ "n", "v" }, "<leader>sp", "<cmd>lua require('vscode').action('workbench.actions.view.problems')<CR>")
keymap({ "n", "v" }, "<leader>cn", "<cmd>lua require('vscode').action('notifications.clearAll')<CR>")
keymap({ "n", "v" }, "<leader>ff", "<cmd>lua require('vscode').action('workbench.action.quickOpen')<CR>")
keymap({ "n", "v" }, "<leader>cp", "<cmd>lua require('vscode').action('workbench.action.showCommands')<CR>")
keymap({ "n", "v" }, "<leader>pr", "<cmd>lua require('vscode').action('code-runner.run')<CR>")
keymap({ "n", "v" }, "<leader>fd", "<cmd>lua require('vscode').action('editor.action.formatDocument')<CR>")