major update
This commit is contained in:
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
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,36 +0,0 @@
|
||||
local g = vim.g
|
||||
local o = vim.opt
|
||||
|
||||
g.mapleader = " "
|
||||
g.maplocalleader = " "
|
||||
|
||||
o.nu = true
|
||||
o.number = true
|
||||
o.relativenumber = true
|
||||
o.swapfile = false
|
||||
o.mouse = ""
|
||||
o.tabstop = 4
|
||||
o.softtabstop = 4
|
||||
o.shiftwidth = 4
|
||||
o.expandtab = false
|
||||
o.smartindent = true
|
||||
o.wrap = false
|
||||
o.incsearch = true
|
||||
o.termguicolors = true
|
||||
o.scrolloff = 8
|
||||
o.signcolumn = "yes"
|
||||
o.updatetime = 50
|
||||
o.colorcolumn = "80"
|
||||
o.spelllang = { 'en_us' }
|
||||
o.listchars = {
|
||||
tab = "» ",
|
||||
trail = "·",
|
||||
extends = "⟩",
|
||||
precedes = "⟨",
|
||||
nbsp = "␣"
|
||||
}
|
||||
o.list = true
|
||||
o.shell = "bash"
|
||||
|
||||
-- only show the invisible characters inside the code editing buffers
|
||||
vim.cmd([[autocmd BufWinEnter * if &buftype != '' | setlocal nolist | endif]])
|
||||
Reference in New Issue
Block a user