New: NVIM Config
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
-- lua/core/keymaps.lua
|
||||
|
||||
local keymap = vim.keymap
|
||||
|
||||
-- Set space as leader key
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- General keymaps
|
||||
keymap.set("n", "<leader>e", ":Lex 30<CR>", { desc = "Open file explorer" })
|
||||
keymap.set("n", "<leader>w", ":w<CR>", { desc = "Save file" })
|
||||
keymap.set("n", "<leader>q", ":q<CR>", { desc = "Quit" })
|
||||
keymap.set("n", "<leader>h", ":nohlsearch<CR>", { desc = "Clear search highlight" })
|
||||
|
||||
-- Telescope keymaps
|
||||
keymap.set("n", "<leader>tf", "<cmd>Telescope find_files<cr>", { desc = "Find Files" })
|
||||
keymap.set("n", "<leader>tg", "<cmd>Telescope live_grep<cr>", { desc = "Live Grep" })
|
||||
keymap.set("n", "<leader>tb", "<cmd>Telescope buffers<cr>", { desc = "Find Buffers" })
|
||||
keymap.set("n", "<leader>th", "<cmd>Telescope help_tags<cr>", { desc = "Help Tags" })
|
||||
|
||||
-- Editor format
|
||||
keymap.set("n", "<leader>f", function() vim.lsp.buf.format({ async = true }) end, { desc = "Format Document" })
|
||||
|
||||
-- Window navigation
|
||||
keymap.set("n", "<C-h>", "<C-w>h", { desc = "Move Left" })
|
||||
keymap.set("n", "<C-j>", "<C-w>j", { desc = "Move Down" })
|
||||
keymap.set("n", "<C-k>", "<C-w>k", { desc = "Move Up" })
|
||||
keymap.set("n", "<C-l>", "<C-w>l", { desc = "Move Right" })
|
||||
|
||||
-- Resize with arrows
|
||||
keymap.set("n", "<C-Up>", ":resize -2<CR>", { desc = "Resize Up" })
|
||||
keymap.set("n", "<C-Down>", ":resize +2<CR>", { desc = "Resize Down" })
|
||||
keymap.set("n", "<C-Left>", ":vertical resize -2<CR>", { desc = "Resize Left" })
|
||||
keymap.set("n", "<C-Right>", ":vertical resize +2<CR>", { desc = "Resize Right" })
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
-- lua/core/options.lua
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
-- Line numbers
|
||||
opt.number = true -- Show absolute line number
|
||||
opt.relativenumber = false -- Show relative line numbers
|
||||
|
||||
-- Tabs & indentation
|
||||
opt.tabstop = 4 -- 1 tab = 4 spaces
|
||||
opt.shiftwidth = 4 -- Indent by 4 spaces
|
||||
opt.expandtab = true -- Convert tabs to spaces
|
||||
opt.smartindent = true -- Autoindent new lines
|
||||
|
||||
-- Line wrapping
|
||||
opt.wrap = false -- Don't wrap long lines
|
||||
|
||||
-- Search
|
||||
opt.ignorecase = true -- Ignore case when searching...
|
||||
opt.smartcase = true -- ...unless you use caps
|
||||
|
||||
-- Cursor
|
||||
opt.cursorline = true -- Highlight the current line
|
||||
|
||||
-- Appearance
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.scrolloff = 8 -- Keep 8 lines above/below cursor
|
||||
opt.colorcolumn = "160" -- Show a line at 160 chars
|
||||
|
||||
-- Clipboard
|
||||
opt.clipboard = "unnamedplus" -- Use system clipboard
|
||||
|
||||
-- Split windows
|
||||
opt.splitright = true -- Vertical split to the right
|
||||
opt.splitbelow = true -- Horizontal split below
|
||||
|
||||
-- Backup & Swap
|
||||
opt.swapfile = false
|
||||
opt.backup = false
|
||||
opt.undofile = true -- Save undo history
|
||||
|
||||
-- Mouse
|
||||
opt.mouse = "a" -- Enable mouse in all modes
|
||||
Reference in New Issue
Block a user