Compare commits
4 Commits
66828167e6
...
00290628f8
| Author | SHA1 | Date | |
|---|---|---|---|
| 00290628f8 | |||
| 60a602922e | |||
| 22981a59f6 | |||
| 05b83edc1a |
@@ -3,6 +3,7 @@
|
||||
Inspirations:
|
||||
- [illya](https://codeberg.org/42nerds/nvim)
|
||||
- [nolan](https://github.com/Hrumble/sneaky-nvim-config)
|
||||
- [mats](https://github.com/BeerB34r/dotfiles)
|
||||
|
||||
# Neovim Notes
|
||||
|
||||
@@ -73,6 +74,20 @@ Leave terminal mode and return to normal mode:
|
||||
|
||||
## LSP
|
||||
|
||||
Mason is installed through `vim.pack` together with `mason-lspconfig.nvim` and `nvim-lspconfig`.
|
||||
|
||||
This config automatically installs and enables the managed language servers on first start. The current managed set is `bashls`, `clangd`, `jsonls`, `lua_ls`, `marksman`, `taplo`, `ts_ls`, and `yamlls`.
|
||||
|
||||
Useful Mason commands:
|
||||
|
||||
```vim
|
||||
:Mason
|
||||
:MasonLog
|
||||
:checkhealth mason
|
||||
```
|
||||
|
||||
`ts_ls` provides TypeScript and JavaScript language server support after Mason installs `typescript-language-server`.
|
||||
|
||||
When an LSP server is attached to the current buffer:
|
||||
|
||||
- `gd` go to definition
|
||||
|
||||
42
nvim/.config/nvim/lua/romanzy/commands.lua
Normal file
42
nvim/.config/nvim/lua/romanzy/commands.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
local uc = vim.api.nvim_create_user_command
|
||||
local ac = vim.api.nvim_create_autocmd
|
||||
local aug = vim.api.nvim_create_augroup
|
||||
|
||||
-- User commands
|
||||
uc("W", "w|e", { desc = "write file then refresh buffer" })
|
||||
|
||||
-- Auto commands
|
||||
ac("TextYankPost", {
|
||||
desc = "Highlight when yanking text",
|
||||
group = aug("highlight-yank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
ac("LspAttach", {
|
||||
desc = "Notify user about attached LSP clients",
|
||||
group = aug("LSPOnAttach", { clear = true }),
|
||||
callback = function(event)
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client then
|
||||
vim.notify(client.name .. " attached", vim.log.levels.INFO, {})
|
||||
end
|
||||
end,
|
||||
})
|
||||
-- ac("LspAttach", {
|
||||
-- group = aug("lsp_attach_disable_ruff_hover", { clear = true }),
|
||||
-- callback = function(args)
|
||||
-- local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
-- if client == nil then
|
||||
-- return
|
||||
-- end
|
||||
-- if client.name == "ruff" then
|
||||
-- client.server_capabilities.hoverProvider = false
|
||||
-- end
|
||||
-- end,
|
||||
-- desc = "LSP: Disable hover capabilties for ruff",
|
||||
-- })
|
||||
|
||||
|
||||
-- Only show the invisible characters inside the code editing buffers
|
||||
vim.cmd([[autocmd BufWinEnter * if &buftype != '' | setlocal nolist | endif]])
|
||||
@@ -1,3 +1,4 @@
|
||||
require("romanzy.set")
|
||||
require("romanzy.remap")
|
||||
require("romanzy.options")
|
||||
require("romanzy.keymaps")
|
||||
require("romanzy.commands")
|
||||
require("romanzy.plugins")
|
||||
|
||||
@@ -41,7 +41,7 @@ map("n", "<leader>bp", "<Cmd>bprevious<CR>", { desc = "prev buffer" })
|
||||
map("n", "<leader>bn", "<Cmd>bnext<CR>", { desc = "next buffer" })
|
||||
map("n", "<leader>bd", "<Cmd>bdelete<CR>", { desc = "delete buffer" })
|
||||
|
||||
map("t", "<Esc>", "<C-\\><C-n>", { desc = "exit terminal" })
|
||||
map("t", "\\<Esc>", "<C-\\><C-n>", { desc = "exit terminal" })
|
||||
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "window left" })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "window down" })
|
||||
41
nvim/.config/nvim/lua/romanzy/options.lua
Normal file
41
nvim/.config/nvim/lua/romanzy/options.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
local g = vim.g
|
||||
local o = vim.opt
|
||||
|
||||
-- Leaders
|
||||
g.mapleader = " " -- Uses space as the global leader key.
|
||||
g.maplocalleader = " " -- Uses space as the local leader key.
|
||||
|
||||
-- Interface
|
||||
o.number = true -- Shows absolute line numbers.
|
||||
o.relativenumber = true -- Shows relative numbers for easier motion.
|
||||
o.scrolloff = 8 -- Keeps context lines visible around the cursor.
|
||||
o.signcolumn = "yes" -- Always reserves space for signs in the gutter.
|
||||
o.colorcolumn = "+1" -- Highlights the preferred maximum line width.
|
||||
o.wrap = false -- Prevents long lines from wrapping on screen.
|
||||
o.list = true -- Displays whitespace characters using listchars.
|
||||
o.listchars = {
|
||||
tab = "» ",
|
||||
trail = "·",
|
||||
extends = "⟩",
|
||||
precedes = "⟨",
|
||||
nbsp = "␣",
|
||||
} -- Defines how invisible characters are rendered.
|
||||
o.termguicolors = true -- Enables full RGB color support.
|
||||
o.mouse = "" -- Disables mouse support.
|
||||
|
||||
-- Editing
|
||||
o.tabstop = 4 -- Renders tab characters as four columns.
|
||||
o.softtabstop = 4 -- Makes tab/backspace feel like four spaces.
|
||||
o.shiftwidth = 4 -- Uses four columns for each indent step.
|
||||
o.expandtab = false -- Keeps literal tab characters instead of spaces.
|
||||
o.smartindent = true -- Adds indentation automatically on new lines.
|
||||
o.swapfile = false -- Disables swapfile creation.
|
||||
|
||||
-- Search and update behavior
|
||||
o.incsearch = true -- Updates search matches as you type.
|
||||
o.updatetime = 50 -- Reduces idle delay for swap and CursorHold events.
|
||||
o.spelllang = { "en_us" } -- Uses US English for spell checking.
|
||||
|
||||
-- Shell
|
||||
o.shell = "bash" -- Runs shell commands through bash.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
require("romanzy.plugins.rose-pine")
|
||||
require("romanzy.plugins.mini")
|
||||
require("romanzy.plugins.oil")
|
||||
require("romanzy.plugins.telescope")
|
||||
require("romanzy.plugins.nvim-treesitter")
|
||||
|
||||
@@ -104,5 +104,6 @@ end
|
||||
require("mason").setup()
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = managed_servers,
|
||||
automatic_enable = managed_servers,
|
||||
})
|
||||
|
||||
56
nvim/.config/nvim/lua/romanzy/plugins/mini.lua
Normal file
56
nvim/.config/nvim/lua/romanzy/plugins/mini.lua
Normal file
@@ -0,0 +1,56 @@
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/echasnovski/mini.nvim",
|
||||
name = "mini.nvim",
|
||||
branch = "stable",
|
||||
},
|
||||
})
|
||||
|
||||
local clue = require("mini.clue")
|
||||
local icons = require("mini.icons")
|
||||
local git = require("mini.git")
|
||||
local diff = require("mini.diff")
|
||||
local statusline = require("mini.statusline")
|
||||
local hipatterns = require("mini.hipatterns")
|
||||
local ai = require("mini.ai")
|
||||
local notify = require("mini.notify")
|
||||
local surround = require("mini.surround")
|
||||
|
||||
clue.setup({
|
||||
triggers = {
|
||||
{ mode = "n", keys = "<leader>" },
|
||||
{ mode = "n", keys = "g" },
|
||||
{ mode = "n", keys = "z" },
|
||||
{ mode = "i", keys = "<C-x>" },
|
||||
},
|
||||
clues = {
|
||||
clue.gen_clues.builtin_completion(),
|
||||
clue.gen_clues.g(),
|
||||
clue.gen_clues.marks(),
|
||||
clue.gen_clues.registers(),
|
||||
clue.gen_clues.windows(),
|
||||
clue.gen_clues.z(),
|
||||
},
|
||||
window = {
|
||||
delay = 500,
|
||||
},
|
||||
})
|
||||
|
||||
icons.setup({})
|
||||
git.setup({})
|
||||
diff.setup({})
|
||||
statusline.setup({ use_icons = true })
|
||||
hipatterns.setup({
|
||||
highlighters = {
|
||||
fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" },
|
||||
hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" },
|
||||
todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" },
|
||||
note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" },
|
||||
file = { pattern = "%f[%w]()FILE()%f[%W]", group = "MiniHipatternsNote" },
|
||||
hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||
},
|
||||
})
|
||||
ai.setup({})
|
||||
notify.setup({})
|
||||
vim.notify = notify.make_notify()
|
||||
surround.setup({})
|
||||
@@ -1,42 +0,0 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
-- disable normie mouse stuff
|
||||
vim.opt.mouse = ""
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = false
|
||||
|
||||
vim.opt.smartindent = true
|
||||
|
||||
vim.opt.wrap = false -- no line wrapping...
|
||||
|
||||
vim.opt.incsearch = true
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
|
||||
vim.opt.updatetime = 50
|
||||
|
||||
vim.opt.colorcolumn = "80"
|
||||
|
||||
vim.opt.spelllang = { 'en_us' }
|
||||
|
||||
vim.opt.listchars = {
|
||||
tab = "» ",
|
||||
trail = "·",
|
||||
extends = "⟩",
|
||||
precedes = "⟨",
|
||||
nbsp = "␣"
|
||||
}
|
||||
|
||||
vim.opt.list = true
|
||||
-- only show the invisible characters inside the code editing buffers
|
||||
vim.cmd([[autocmd BufWinEnter * if &buftype != '' | setlocal nolist | endif]])
|
||||
|
||||
vim.opt.shell = "bash"
|
||||
@@ -12,6 +12,10 @@
|
||||
"rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d",
|
||||
"src": "https://github.com/mason-org/mason.nvim"
|
||||
},
|
||||
"mini.nvim": {
|
||||
"rev": "1599a473aa6f5290a5d740b1144846e6f0c3963d",
|
||||
"src": "https://github.com/echasnovski/mini.nvim"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "bfcc0171a43f22afa61d927ffe9fcb6cb85dc99e",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
|
||||
Reference in New Issue
Block a user