Compare commits
99 commits
add-metals
...
main
Author | SHA1 | Date | |
---|---|---|---|
Salar Rahmanian | b25a90efbc | ||
085806840e | |||
Salar Rahmanian | 754a8bb8a7 | ||
e725608176 | |||
Salar Rahmanian | dacac8186c | ||
b2957a1307 | |||
Salar Rahmanian | f59b6eedae | ||
852c41e2fd | |||
Salar Rahmanian | 410d1c14a3 | ||
4ad660ff6b | |||
Salar Rahmanian | 1878ca5f5c | ||
e032529ae2 | |||
Salar Rahmanian | a2c83932c8 | ||
2e34ee2c18 | |||
Salar Rahmanian | f55f491c46 | ||
f0f0a04618 | |||
Salar Rahmanian | c160396483 | ||
00741a1f18 | |||
Salar Rahmanian | 6e87f6360a | ||
4dccd81452 | |||
Salar Rahmanian | f49357f038 | ||
889d7df0c7 | |||
Salar Rahmanian | 0e57d13d1d | ||
87a0613402 | |||
Salar Rahmanian | b768459ccf | ||
2c54ee721d | |||
Salar Rahmanian | 8d6d972b8e | ||
05da9e89e0 | |||
Salar Rahmanian | e5cf7829a4 | ||
14ba336744 | |||
Salar Rahmanian | d8983796e9 | ||
59359e9d5e | |||
Salar Rahmanian | 11c5aecb3a | ||
79193d44f7 | |||
Salar Rahmanian | fed5967077 | ||
1dce120f9b | |||
Salar Rahmanian | 71648bb0f8 | ||
b1f111c8ed | |||
Salar Rahmanian | 069573696f | ||
0d0c2c4898 | |||
Salar Rahmanian | 0f6d6b7e16 | ||
21ebd90830 | |||
Salar Rahmanian | d5b436ac78 | ||
b3e023926a | |||
Salar Rahmanian | f875590278 | ||
e321003bb8 | |||
Salar Rahmanian | 12c5e919e8 | ||
97b02badad | |||
Salar Rahmanian | 20abfd7ad7 | ||
11315a02af | |||
Salar Rahmanian | 6f0048ce70 | ||
f6da4d1530 | |||
Salar Rahmanian | a58443e9e5 | ||
b89b3e708b | |||
49af022e9a | |||
127bb29002 | |||
0c64477fde | |||
023d479cad | |||
eb90680227 | |||
30857126bc | |||
d1f3552a6b | |||
bfe51501c0 | |||
a2a4948626 | |||
c740bd0b9a | |||
543a87b647 | |||
ed9cdefbfe | |||
adab4c9868 | |||
ac7708c702 | |||
8afb4ac78d | |||
9de4e06a7d | |||
b25ff7fe59 | |||
c2d6d6379d | |||
c66027a361 | |||
980db5dbf8 | |||
e70fbda549 | |||
38cb2ecab7 | |||
bc2b71fa94 | |||
3c5cdb2304 | |||
b873a14c3a | |||
8f9763738d | |||
a07069f030 | |||
e7dfc75b15 | |||
e2ac81a656 | |||
5dc56d22aa | |||
ff03b6eaaf | |||
8b3d267492 | |||
3ae37019b1 | |||
f1ca602f8d | |||
e745fc4ec9 | |||
a8853c25bb | |||
30228420ad | |||
62974959b4 | |||
9431d011d1 | |||
89193f43b4 | |||
7b6176d6d7 | |||
7ad9b5a141 | |||
fe22d20eb7 | |||
93367a7b62 | |||
cca1375fa9 |
184
init.lua
184
init.lua
|
@ -1,86 +1,102 @@
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
if vim.g.vscode then
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
-- VSCode Neovim
|
||||||
vim.fn.system({
|
require("user.vscode_keymaps")
|
||||||
"git",
|
else
|
||||||
"clone",
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
"--filter=blob:none",
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
vim.fn.system({
|
||||||
"--branch=stable", -- latest stable release
|
"git",
|
||||||
lazypath,
|
"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 = "*",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- 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
|
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
|
|
||||||
|
|
46
lua/plugins/conform.lua
Normal file
46
lua/plugins/conform.lua
Normal 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
14
lua/plugins/copilot.lua
Normal 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,
|
||||||
|
}
|
48
lua/plugins/gen.lua
Normal file
48
lua/plugins/gen.lua
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
return {
|
||||||
|
"David-Kunz/gen.nvim",
|
||||||
|
lazy = true,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>ai", ":Gen<CR>", mode = { "n", "v" }, desc = "AI tools using Ollama" },
|
||||||
|
{ "<leader>aa", ":Gen Ask<CR>", mode = { "n", "v" }, desc = "[A]I [A]sk" },
|
||||||
|
{
|
||||||
|
"<leader>am",
|
||||||
|
function()
|
||||||
|
require("gen").select_model()
|
||||||
|
end,
|
||||||
|
mode = { "n", "v" },
|
||||||
|
desc = "Select [A]I [m]odel",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("gen").setup({
|
||||||
|
{
|
||||||
|
model = "codellama",
|
||||||
|
host = "localhost",
|
||||||
|
port = "11434",
|
||||||
|
quit_map = "q",
|
||||||
|
retry_map = "<c-r>",
|
||||||
|
init = function(options)
|
||||||
|
pcall(io.popen, "ollama serve > /dev/null 2>&1 &")
|
||||||
|
end,
|
||||||
|
command = function(options)
|
||||||
|
local body = { model = options.model, stream = true }
|
||||||
|
return "curl --silent --no-buffer -X POST http://"
|
||||||
|
.. options.host
|
||||||
|
.. ":"
|
||||||
|
.. options.port
|
||||||
|
.. "/api/chat -d $body"
|
||||||
|
end,
|
||||||
|
display_mode = "split", -- "split" or "float"
|
||||||
|
show_prompt = true,
|
||||||
|
show_model = true,
|
||||||
|
no_auto_close = false,
|
||||||
|
debug = false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("gen").prompts["Fix_Code"] = {
|
||||||
|
prompt = "Fix the following code. Only ouput the result in format ```$filetype\n...\n```:\n```$filetype\n$text\n```",
|
||||||
|
replace = true,
|
||||||
|
extract = "```$filetype\n(.-)```",
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
12
lua/plugins/img-clip.lua
Normal file
12
lua/plugins/img-clip.lua
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
return {
|
||||||
|
"HakonHarnes/img-clip.nvim",
|
||||||
|
event = "BufEnter",
|
||||||
|
opts = {
|
||||||
|
-- add options here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
-- suggested keymap
|
||||||
|
{ "<leader>p", "<cmd>PasteImage<cr>", desc = "Paste clipboard image" },
|
||||||
|
},
|
||||||
|
}
|
|
@ -27,6 +27,8 @@ return {
|
||||||
{ "folke/which-key.nvim", lazy = false },
|
{ "folke/which-key.nvim", lazy = false },
|
||||||
{
|
{
|
||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
|
tag = "legacy",
|
||||||
|
event = "LspAttach",
|
||||||
config = function()
|
config = function()
|
||||||
require("fidget").setup()
|
require("fidget").setup()
|
||||||
end,
|
end,
|
||||||
|
@ -44,20 +46,12 @@ return {
|
||||||
"softinio/scaladex.nvim",
|
"softinio/scaladex.nvim",
|
||||||
{
|
{
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
main = "ibl",
|
||||||
config = function()
|
config = function()
|
||||||
require("indent_blankline").setup({
|
require("ibl").setup({
|
||||||
char = "┊",
|
indent = { char = "┊" },
|
||||||
show_trailing_blankline_indent = false,
|
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
"tpope/vim-fugitive",
|
"SidOfc/mkdx",
|
||||||
"tpope/vim-rhubarb",
|
|
||||||
"tpope/vim-sleuth",
|
|
||||||
{
|
|
||||||
"numToStr/Comment.nvim",
|
|
||||||
config = function()
|
|
||||||
require("Comment").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
return {
|
return {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Automatically install LSPs to stdpath for neovim
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
|
|
||||||
-- Useful status updates for LSP
|
-- Useful status updates for LSP
|
||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
|
|
||||||
|
@ -13,6 +9,8 @@ return {
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- LSP settings.
|
-- LSP settings.
|
||||||
|
-- Require the lspconfig module
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
-- This function gets run when an LSP connects to a particular buffer.
|
-- This function gets run when an LSP connects to a particular buffer.
|
||||||
local on_attach = function(_, bufnr)
|
local on_attach = function(_, bufnr)
|
||||||
-- NOTE: Remember that lua is a real programming language, and as such it is possible
|
-- NOTE: Remember that lua is a real programming language, and as such it is possible
|
||||||
|
@ -57,49 +55,62 @@ return {
|
||||||
end, { desc = "Format current buffer with LSP" })
|
end, { desc = "Format current buffer with LSP" })
|
||||||
end
|
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 = {
|
local servers = {
|
||||||
-- clangd = {},
|
bashls = {
|
||||||
-- gopls = {},
|
bashIde = {
|
||||||
-- pyright = {},
|
globPattern = "*@(.sh|.inc|.bash|.command)",
|
||||||
-- rust_analyzer = {},
|
},
|
||||||
-- tsserver = {},
|
},
|
||||||
|
lua_ls = {
|
||||||
sumneko_lua = {
|
|
||||||
Lua = {
|
Lua = {
|
||||||
|
diagnostics = { globals = { "vim" } },
|
||||||
workspace = { checkThirdParty = false },
|
workspace = { checkThirdParty = false },
|
||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
html = {},
|
||||||
|
jqls = {},
|
||||||
|
jsonls = {},
|
||||||
|
marksman = {},
|
||||||
|
nil_ls = {},
|
||||||
|
nixd = {},
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rust_analyzer = {
|
||||||
|
diagnostics = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ts_ls = {},
|
||||||
|
yamlls = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
--
|
|
||||||
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||||
|
|
||||||
-- Setup mason so it can manage external tooling
|
-- Iterate over the servers table and configure each one
|
||||||
require("mason").setup()
|
for server, config in pairs(servers) do
|
||||||
|
-- Set up the server using the `config` if provided, otherwise just `on_attach` and `capabilities`
|
||||||
-- Ensure the servers above are installed
|
lspconfig[server].setup({
|
||||||
local mason_lspconfig = require("mason-lspconfig")
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
mason_lspconfig.setup({
|
settings = config, -- Pass the specific server settings here
|
||||||
ensure_installed = vim.tbl_keys(servers),
|
})
|
||||||
})
|
end
|
||||||
|
|
||||||
mason_lspconfig.setup_handlers({
|
|
||||||
function(server_name)
|
|
||||||
require("lspconfig")[server_name].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
settings = servers[server_name],
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,47 @@ return {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
|
-- Default from its README then customized
|
||||||
|
-- Added metals status
|
||||||
require("lualine").setup({
|
require("lualine").setup({
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = false,
|
icons_enabled = true,
|
||||||
theme = "tokyonight",
|
theme = "auto",
|
||||||
component_separators = "|",
|
component_separators = { left = "", right = "" },
|
||||||
section_separators = "",
|
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,
|
end,
|
||||||
}
|
}
|
||||||
|
|
4
lua/plugins/markdown-composer.lua
Normal file
4
lua/plugins/markdown-composer.lua
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
return {
|
||||||
|
"euclio/vim-markdown-composer",
|
||||||
|
build = "cargo build --release",
|
||||||
|
}
|
|
@ -10,6 +10,17 @@ return {
|
||||||
{ "<leader>m", "<cmd>Neotree toggle<cr>", desc = "NeoTree" },
|
{ "<leader>m", "<cmd>Neotree toggle<cr>", desc = "NeoTree" },
|
||||||
},
|
},
|
||||||
config = function()
|
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,
|
end,
|
||||||
}
|
}
|
||||||
|
|
40
lua/plugins/neotest.lua
Normal file
40
lua/plugins/neotest.lua
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
return {
|
||||||
|
"nvim-neotest/neotest",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-neotest/nvim-nio",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"rcasia/neotest-java",
|
||||||
|
"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-java"] = {},
|
||||||
|
["neotest-python"] = {
|
||||||
|
runner = "pytest",
|
||||||
|
args = { "-vvv" },
|
||||||
|
python = ".venv/bin/python",
|
||||||
|
},
|
||||||
|
["neotest-scala"] = {
|
||||||
|
runner = "sbt",
|
||||||
|
command = "test",
|
||||||
|
framework = "munit",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -1,16 +1,42 @@
|
||||||
return {
|
return {
|
||||||
"scalameta/nvim-metals",
|
"scalameta/nvim-metals",
|
||||||
|
lazy = false,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>ws", "<cmd>lua require'metals'.hover_worksheet()<cr>", desc = "Metals Worksheet" },
|
{ "<leader>ws", "<cmd>lua require'metals'.hover_worksheet()<cr>", desc = "Metals Worksheet" },
|
||||||
|
{
|
||||||
|
"<leader>sm",
|
||||||
|
"<cmd>lua require'telescope'.extensions.metals.commands()<cr>",
|
||||||
|
desc = "Telescope Metals Commands",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local metals_config = require("metals").bare_config()
|
local metals_config = require("metals").bare_config()
|
||||||
|
metals_config.tvp = {
|
||||||
|
icons = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
metals_config.settings = {
|
metals_config.settings = {
|
||||||
|
serverVersion = "latest.snapshot",
|
||||||
|
useGlobalExecutable = true,
|
||||||
showImplicitArguments = true,
|
showImplicitArguments = true,
|
||||||
|
showImplicitConversionsAndClasses = true,
|
||||||
|
showInferredType = true,
|
||||||
|
bloopSbtAlreadyInstalled = true,
|
||||||
excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" },
|
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.init_options.statusBarProvider = "on"
|
||||||
|
|
||||||
metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()
|
metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
25
lua/plugins/octo.lua
Normal file
25
lua/plugins/octo.lua
Normal 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" },
|
||||||
|
},
|
||||||
|
}
|
4
lua/plugins/overseer.lua
Normal file
4
lua/plugins/overseer.lua
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
return {
|
||||||
|
"stevearc/overseer.nvim",
|
||||||
|
opts = {},
|
||||||
|
}
|
|
@ -4,6 +4,8 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||||
|
"debugloop/telescope-undo.nvim",
|
||||||
|
"nvim-telescope/telescope-ui-select.nvim",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("telescope").setup({
|
require("telescope").setup({
|
||||||
|
@ -20,6 +22,8 @@ return {
|
||||||
-- Enable telescope fzf native, if installed
|
-- Enable telescope fzf native, if installed
|
||||||
pcall(require("telescope").load_extension, "fzf")
|
pcall(require("telescope").load_extension, "fzf")
|
||||||
pcall(require("telescope").load_extension, "scaladex")
|
pcall(require("telescope").load_extension, "scaladex")
|
||||||
|
pcall(require("telescope").load_extension, "ui-select")
|
||||||
|
pcall(require("telescope").load_extension, "undo")
|
||||||
|
|
||||||
-- See `:help telescope.builtin`
|
-- See `:help telescope.builtin`
|
||||||
vim.keymap.set("n", "<leader>?", require("telescope.builtin").oldfiles, { desc = "[?] Find recently opened files" })
|
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>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>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>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,
|
end,
|
||||||
}
|
}
|
||||||
|
|
12
lua/plugins/todo-comments.lua
Normal file
12
lua/plugins/todo-comments.lua
Normal 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
|
||||||
|
},
|
||||||
|
}
|
|
@ -9,23 +9,18 @@ return {
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
-- Add languages to be installed here that you want installed for treesitter
|
-- Add languages to be installed here that you want installed for treesitter
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
|
"awk",
|
||||||
|
"bash",
|
||||||
"c",
|
"c",
|
||||||
"cpp",
|
"cpp",
|
||||||
"go",
|
"css",
|
||||||
"lua",
|
|
||||||
"python",
|
|
||||||
"rust",
|
|
||||||
"typescript",
|
|
||||||
"help",
|
|
||||||
"vim",
|
|
||||||
"scala",
|
|
||||||
"bash",
|
|
||||||
"dockerfile",
|
"dockerfile",
|
||||||
"fish",
|
"fish",
|
||||||
"git_rebase",
|
"git_rebase",
|
||||||
"gitattributes",
|
"gitattributes",
|
||||||
"gitcommit",
|
"gitcommit",
|
||||||
"gitignore",
|
"gitignore",
|
||||||
|
"go",
|
||||||
"haskell",
|
"haskell",
|
||||||
"hocon",
|
"hocon",
|
||||||
"html",
|
"html",
|
||||||
|
@ -34,12 +29,24 @@ return {
|
||||||
"javascript",
|
"javascript",
|
||||||
"json",
|
"json",
|
||||||
"json5",
|
"json5",
|
||||||
|
"jsonc",
|
||||||
"latex",
|
"latex",
|
||||||
|
"lua",
|
||||||
"make",
|
"make",
|
||||||
"markdown_inline",
|
"markdown_inline",
|
||||||
"nix",
|
"nix",
|
||||||
|
"proto",
|
||||||
|
"python",
|
||||||
|
"rust",
|
||||||
|
"scala",
|
||||||
|
"scss",
|
||||||
"sql",
|
"sql",
|
||||||
|
"swift",
|
||||||
"terraform",
|
"terraform",
|
||||||
|
"toml",
|
||||||
|
"typescript",
|
||||||
|
"vim",
|
||||||
|
"xml",
|
||||||
"yaml",
|
"yaml",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -51,7 +58,7 @@ return {
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
|
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true, disable = { "python" } },
|
indent = { enable = false },
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
|
|
41
lua/user/vscode_keymaps.lua
Normal file
41
lua/user/vscode_keymaps.lua
Normal 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>")
|
Loading…
Reference in a new issue