Compare commits
10 Commits
1e3a6aab29
...
3acaf94e3b
| Author | SHA1 | Date | |
|---|---|---|---|
| 3acaf94e3b | |||
| 87512c348d | |||
| 144464164f | |||
| 759ed96ac1 | |||
| 8ffda69a16 | |||
| b57029e65d | |||
| 387b7071e8 | |||
| 1d906c7440 | |||
| 94502eca9f | |||
| 3e57449f50 |
@@ -1,12 +1,12 @@
|
|||||||
# Nvimconfigs #
|
# Nvimconfigs #
|
||||||
|
|
||||||
My neovim settings. Contrary to popular opinion of breaking down your configs, this configuration is a single file because why not!! It is becoming very difficult to split them anyways with plugin dependencies on other settings, plugins defining keybinds in their setup and so on.
|
My neovim settings. Contrary to popular opinion of breaking down your configs, this configuration is a single file because why not!! It is very difficult to split them anyways with plugin dependencies on other plugins, plugins defining keybinds in their setup and so on.
|
||||||
|
|
||||||
This uses Lazy as the plugin manager.
|
This uses Lazy as the plugin manager.
|
||||||
|
|
||||||
# Prerequisites #
|
# Prerequisites #
|
||||||
|
|
||||||
- Tested on Arch and Windows native. Should probably work on most linux distros.
|
- Tested on Arch and Windows native. Should probably work on both linux and windows.
|
||||||
- `neovim`
|
- `neovim`
|
||||||
- `npm`
|
- `npm`
|
||||||
- `python`
|
- `python`
|
||||||
@@ -15,19 +15,17 @@ This uses Lazy as the plugin manager.
|
|||||||
- `go`
|
- `go`
|
||||||
- `rust`
|
- `rust`
|
||||||
- `ripgrep` - for fuzzy searching
|
- `ripgrep` - for fuzzy searching
|
||||||
- `fzf` - for fuzzy searching
|
|
||||||
- `zk` - for notetaking
|
|
||||||
|
|
||||||
# Installation #
|
# Installation #
|
||||||
|
|
||||||
- `make install` if on linux.
|
- `make install` if on linux.
|
||||||
|
- Otherwise, follow the manual process below
|
||||||
|
|
||||||
## Manually ##
|
## Manually ##
|
||||||
|
|
||||||
Above command will take a backup of your current vim settings in `~/.config/nvim/init.lua` and installs the configs from this project. Therefore, to install manually, you can
|
Above command will take a backup of your current vim settings in `~/.config/nvim/init.lua` and installs the configs from this project. Therefore, to install manually, you can
|
||||||
|
|
||||||
- Download and place this manually as well in that location
|
- Download and place this manually in that location. On windows, it is `$env:LocalAppData\nvim\init.lua`. On Linux, it is `~/.config/nvim/init.lua`.
|
||||||
- Download it elsewhere and create a symlink to this file
|
|
||||||
|
|
||||||
# Post Install #
|
# Post Install #
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ O.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
|||||||
if OS == "win" then
|
if OS == "win" then
|
||||||
-- The newer pwsh is faster, but this is required for some legacy functionality
|
-- The newer pwsh is faster, but this is required for some legacy functionality
|
||||||
-- such as [G]o [T]eams below.
|
-- such as [G]o [T]eams below.
|
||||||
O.shell = "powershell" -- or the newer pwsh
|
O.shell = "powershell" -- powershell = NET Framework, pwsh = .NET Core
|
||||||
O.shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy Bypass -Command"
|
O.shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy Bypass -Command"
|
||||||
O.shellxquote = ''
|
O.shellxquote = ''
|
||||||
end
|
end
|
||||||
@@ -81,64 +81,17 @@ lazy.setup({
|
|||||||
-------------
|
-------------
|
||||||
-- Colors --
|
-- Colors --
|
||||||
-------------
|
-------------
|
||||||
"catppuccin/nvim",
|
'arcticicestudio/nord-vim',
|
||||||
name = "catppuccin",
|
lazy = false,
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
require('catppuccin').setup({
|
V.cmd([[colorscheme nord]])
|
||||||
flavour = "frappe", -- latte, frappe, macchiato, mocha
|
|
||||||
background = { -- :h background
|
|
||||||
light = "frappe",
|
|
||||||
dark = "mocha",
|
|
||||||
},
|
|
||||||
transparent_background = true, -- disables setting the background color.
|
|
||||||
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
|
|
||||||
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
|
|
||||||
dim_inactive = {
|
|
||||||
enabled = false, -- dims the background color of inactive window
|
|
||||||
shade = "dark",
|
|
||||||
percentage = 0.15, -- percentage of the shade to apply to the inactive window
|
|
||||||
},
|
|
||||||
no_italic = false, -- Force no italic
|
|
||||||
no_bold = false, -- Force no bold
|
|
||||||
no_underline = false, -- Force no underline
|
|
||||||
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
|
|
||||||
comments = { "bold" }, -- Change the style of comments
|
|
||||||
conditionals = {},
|
|
||||||
loops = {},
|
|
||||||
functions = {},
|
|
||||||
keywords = {},
|
|
||||||
strings = {},
|
|
||||||
variables = {},
|
|
||||||
numbers = {},
|
|
||||||
booleans = {},
|
|
||||||
properties = {},
|
|
||||||
types = {},
|
|
||||||
operators = {},
|
|
||||||
-- miscs = {}, -- Uncomment to turn off hard-coded styles
|
|
||||||
},
|
|
||||||
color_overrides = {},
|
|
||||||
custom_highlights = {},
|
|
||||||
integrations = {
|
|
||||||
cmp = true,
|
|
||||||
gitsigns = true,
|
|
||||||
nvimtree = true,
|
|
||||||
treesitter = true,
|
|
||||||
notify = false,
|
|
||||||
mini = {
|
|
||||||
enabled = true,
|
|
||||||
indentscope_color = "",
|
|
||||||
},
|
|
||||||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
|
||||||
},
|
|
||||||
})
|
|
||||||
V.cmd([[colorscheme catppuccin-frappe]])
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'nvim-lualine/lualine.nvim',
|
'nvim-lualine/lualine.nvim',
|
||||||
opts = {
|
opts = {
|
||||||
theme = "catppuccin-frappe"
|
theme = "nordic"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -189,7 +142,7 @@ lazy.setup({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Nvim-notify will be plugged into the default vim notify system for a
|
-- Nvim-notify will be plugged into the default vim notify system for a
|
||||||
-- better notification box
|
-- better notification box
|
||||||
{
|
{
|
||||||
"rcarriga/nvim-notify",
|
"rcarriga/nvim-notify",
|
||||||
@@ -206,7 +159,7 @@ lazy.setup({
|
|||||||
config = function()
|
config = function()
|
||||||
require('notify').setup({
|
require('notify').setup({
|
||||||
stages = "static",
|
stages = "static",
|
||||||
timeout = 3000,
|
timeout = 500,
|
||||||
max_height = function()
|
max_height = function()
|
||||||
return math.floor(V.o.lines * 0.75)
|
return math.floor(V.o.lines * 0.75)
|
||||||
end,
|
end,
|
||||||
@@ -247,14 +200,21 @@ lazy.setup({
|
|||||||
"ThePrimeagen/harpoon",
|
"ThePrimeagen/harpoon",
|
||||||
branch = "harpoon2",
|
branch = "harpoon2",
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
config = function()
|
config = true,
|
||||||
local harpoon = require("harpoon")
|
keys = {
|
||||||
harpoon.setup({})
|
{
|
||||||
|
'<leader>hh',
|
||||||
local opts = { noremap = true, silent = true }
|
function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end,
|
||||||
V.keymap.set('n', '<leader>hh', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, opts)
|
desc =
|
||||||
V.keymap.set('n', '<leader>ha', function() harpoon:list():append() end, opts)
|
"[H]arpoon [H]ome"
|
||||||
end
|
},
|
||||||
|
{
|
||||||
|
'<leader>ha',
|
||||||
|
function() require("harpoon"):list():add() end,
|
||||||
|
desc =
|
||||||
|
"[H]arpoon [A]ppend"
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
---------------
|
---------------
|
||||||
@@ -369,10 +329,10 @@ lazy.setup({
|
|||||||
},
|
},
|
||||||
|
|
||||||
-- Copilot!!
|
-- Copilot!!
|
||||||
{
|
-- {
|
||||||
"github/copilot.vim",
|
-- "github/copilot.vim",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
-- event = { "BufReadPre", "BufNewFile" },
|
||||||
},
|
-- },
|
||||||
|
|
||||||
-- lspconfig is the configuration framework for the nvim lsp client. It has best effort
|
-- lspconfig is the configuration framework for the nvim lsp client. It has best effort
|
||||||
-- configs for every language. Mason.nvim is the plugin that will install the lsp servers
|
-- configs for every language. Mason.nvim is the plugin that will install the lsp servers
|
||||||
@@ -409,7 +369,7 @@ lazy.setup({
|
|||||||
["textDocument/hover"] = V.lsp.with(V.lsp.handlers.hover, { border = border }),
|
["textDocument/hover"] = V.lsp.with(V.lsp.handlers.hover, { border = border }),
|
||||||
["textDocument/signatureHelp"] = V.lsp.with(V.lsp.handlers.signature_help, { border = border }),
|
["textDocument/signatureHelp"] = V.lsp.with(V.lsp.handlers.signature_help, { border = border }),
|
||||||
}
|
}
|
||||||
require("lspconfig").rust_analyzer.setup { handlers = handlers }
|
require("lspconfig").rust_analyzer.setup({ handlers = handlers })
|
||||||
|
|
||||||
-- C# --
|
-- C# --
|
||||||
local omnisharp_extended = require("omnisharp_extended") -- decompilation support
|
local omnisharp_extended = require("omnisharp_extended") -- decompilation support
|
||||||
@@ -421,16 +381,16 @@ lazy.setup({
|
|||||||
["textDocument/implementation"] = omnisharp_extended.implementation_handler,
|
["textDocument/implementation"] = omnisharp_extended.implementation_handler,
|
||||||
}
|
}
|
||||||
|
|
||||||
require("lspconfig").omnisharp.setup {
|
require("lspconfig").omnisharp.setup({
|
||||||
handlers = omnisharp_handlers,
|
handlers = omnisharp_handlers,
|
||||||
enable_editorconfig_support = true,
|
enable_editorconfig_support = true,
|
||||||
enable_ms_build_load_projects_on_demand = false,
|
enable_ms_build_load_projects_on_demand = false,
|
||||||
enable_roslyn_analyzers = true,
|
enable_roslyn_analyzers = true,
|
||||||
organize_imports_on_format = true,
|
organize_imports_on_format = true,
|
||||||
enable_import_completion = false,
|
enable_import_completion = true,
|
||||||
sdk_include_prereleases = true,
|
sdk_include_prereleases = true,
|
||||||
analyze_open_documents_only = true,
|
analyze_open_documents_only = true,
|
||||||
}
|
})
|
||||||
|
|
||||||
-- Add default LSP keybindings
|
-- Add default LSP keybindings
|
||||||
V.api.nvim_create_autocmd('LspAttach', {
|
V.api.nvim_create_autocmd('LspAttach', {
|
||||||
@@ -464,6 +424,10 @@ lazy.setup({
|
|||||||
V.keymap.set('n', '<leader>fe', V.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
|
V.keymap.set('n', '<leader>fe', V.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
|
||||||
V.keymap.set('n', '<leader>fd', V.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
V.keymap.set('n', '<leader>fd', V.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||||
V.keymap.set('n', '<leader>fe', V.diagnostic.open_float, { desc = 'Open diagnostic message on the line' })
|
V.keymap.set('n', '<leader>fe', V.diagnostic.open_float, { desc = 'Open diagnostic message on the line' })
|
||||||
|
-- Define some keybinding to build the current solution
|
||||||
|
V.keymap.set('n', '<leader>dtb', function()
|
||||||
|
V.cmd('!dotnet build')
|
||||||
|
end, { silent = true })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
@@ -474,15 +438,16 @@ lazy.setup({
|
|||||||
-- This plugin provides a way to configure which LSP servers to install
|
-- This plugin provides a way to configure which LSP servers to install
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require('mason-lspconfig').setup {
|
require('mason-lspconfig').setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
"powershell_es",
|
"powershell_es",
|
||||||
"rust_analyzer",
|
"rust_analyzer",
|
||||||
"omnisharp",
|
"omnisharp",
|
||||||
|
-- "omnisharp@1.39.8", -- The last known good version
|
||||||
-- "netcoredbg", Install this manually, this is DAP, not LSP
|
-- "netcoredbg", Install this manually, this is DAP, not LSP
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- This plugin provides a way to install LSP and DAP servers
|
-- This plugin provides a way to install LSP and DAP servers
|
||||||
@@ -603,7 +568,7 @@ lazy.setup({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Below configuration tells how to launch a debugging interactive session for a C#
|
-- Below configuration tells how to launch a debugging interactive session for a C#
|
||||||
-- application when using the netcoredbg adapeter.
|
-- application when using the netcoredbg adapeter.
|
||||||
dap.configurations.cs = {
|
dap.configurations.cs = {
|
||||||
{
|
{
|
||||||
@@ -643,10 +608,40 @@ lazy.setup({
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Shows a popups with the keybindings that are available after a small delay
|
-- Treesitter
|
||||||
{
|
{
|
||||||
"folke/which-key.nvim",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
config = true
|
branch = 'master',
|
||||||
|
lazy = false,
|
||||||
|
build = ":TSUpdate",
|
||||||
|
opts_extend = { "ensure_installed" },
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"rust",
|
||||||
|
"lua",
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
"ruby",
|
||||||
|
"markdown",
|
||||||
|
"bash",
|
||||||
|
"c_sharp",
|
||||||
|
"ruby",
|
||||||
|
"html",
|
||||||
|
"yaml",
|
||||||
|
"text",
|
||||||
|
"gitignore",
|
||||||
|
"markdown_inline",
|
||||||
|
"json",
|
||||||
|
"toml",
|
||||||
|
"xml",
|
||||||
|
"gitcommit",
|
||||||
|
"make",
|
||||||
|
"html",
|
||||||
|
"scss",
|
||||||
|
"yaml",
|
||||||
|
"git_config"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -680,7 +675,10 @@ keymap("x", "<A-k>", ":move '<-2<cr>gv-gv", opts)
|
|||||||
|
|
||||||
-- Misc
|
-- Misc
|
||||||
keymap('n', '<S-u>', ':red<cr>', opts)
|
keymap('n', '<S-u>', ':red<cr>', opts)
|
||||||
keymap('n', '<ESC>', '<cmd>nohlsearch<cr>', {})
|
keymap('n', '<ESC>', '<cmd>nohlsearch<cr>', opts)
|
||||||
|
|
||||||
|
-- Run rust programs
|
||||||
|
keymap('n', '<leader>rr', ':!cargo run<cr>', opts)
|
||||||
|
|
||||||
----------
|
----------
|
||||||
-- Misc --
|
-- Misc --
|
||||||
|
|||||||
Reference in New Issue
Block a user