mirror of
https://github.com/xsghetti/HyprCrux.git
synced 2025-07-03 05:40:38 -04:00
add nvim config
This commit is contained in:
parent
e740023762
commit
4dbb2cbe7e
31 changed files with 691 additions and 0 deletions
3
.config/nvim/lua/crux/core/init.lua
Normal file
3
.config/nvim/lua/crux/core/init.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
require("crux.core.options")
|
||||
require("crux.core.options")
|
||||
require("crux.core.keymaps")
|
32
.config/nvim/lua/crux/core/keymaps.lua
Normal file
32
.config/nvim/lua/crux/core/keymaps.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
-- set leader key to space
|
||||
vim.g.mapleader = " "
|
||||
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
---------------------
|
||||
-- General Keymaps -------------------
|
||||
|
||||
-- use jk to exit insert mode
|
||||
keymap.set("i", "jk", "<ESC>", { desc = "Exit insert mode with jk" })
|
||||
|
||||
-- clear search highlights
|
||||
keymap.set("n", "<leader>nh", ":nohl<CR>", { desc = "Clear search highlights" })
|
||||
|
||||
-- delete single character without copying into register
|
||||
-- keymap.set("n", "x", '"_x')
|
||||
|
||||
-- increment/decrement numbers
|
||||
keymap.set("n", "<leader>+", "<C-a>", { desc = "Increment number" }) -- increment
|
||||
keymap.set("n", "<leader>-", "<C-x>", { desc = "Decrement number" }) -- decrement
|
||||
|
||||
-- window management
|
||||
keymap.set("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
|
||||
keymap.set("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally
|
||||
keymap.set("n", "<leader>se", "<C-w>=", { desc = "Make splits equal size" }) -- make split windows equal width & height
|
||||
keymap.set("n", "<leader>sx", "<cmd>close<CR>", { desc = "Close current split" }) -- close current split window
|
||||
|
||||
keymap.set("n", "<leader>to", "<cmd>tabnew<CR>", { desc = "Open new tab" }) -- open new tab
|
||||
keymap.set("n", "<leader>tx", "<cmd>tabclose<CR>", { desc = "Close current tab" }) -- close current tab
|
||||
keymap.set("n", "<leader>tn", "<cmd>tabn<CR>", { desc = "Go to next tab" }) -- go to next tab
|
||||
keymap.set("n", "<leader>tp", "<cmd>tabp<CR>", { desc = "Go to previous tab" }) -- go to previous tab
|
||||
keymap.set("n", "<leader>tf", "<cmd>tabnew %<CR>", { desc = "Open current buffer in new tab" }) -- move current buffer to new tab
|
44
.config/nvim/lua/crux/core/options.lua
Normal file
44
.config/nvim/lua/crux/core/options.lua
Normal file
|
@ -0,0 +1,44 @@
|
|||
vim.cmd("let g:netrw_liststyle = 3")
|
||||
|
||||
local opt = vim.opt -- for conciseness
|
||||
|
||||
-- line numbers
|
||||
opt.relativenumber = false -- show relative line numbers
|
||||
opt.number = true -- shows absolute line number on cursor line (when relative number is on)
|
||||
|
||||
-- tabs & indentation
|
||||
opt.tabstop = 2 -- 2 spaces for tabs (prettier default)
|
||||
opt.shiftwidth = 2 -- 2 spaces for indent width
|
||||
opt.expandtab = true -- expand tab to spaces
|
||||
opt.autoindent = true -- copy indent from current line when starting new one
|
||||
|
||||
-- line wrapping
|
||||
opt.wrap = false -- disable line wrapping
|
||||
|
||||
-- search settings
|
||||
opt.ignorecase = true -- ignore case when searching
|
||||
opt.smartcase = true -- if you include mixed case in your search, assumes you want case-sensitive
|
||||
|
||||
-- cursor line
|
||||
opt.cursorline = true -- highlight the current cursor line
|
||||
|
||||
-- appearance
|
||||
|
||||
-- turn on termguicolors for nightfly colorscheme to work
|
||||
-- (have to use iterm2 or any other true color terminal)
|
||||
opt.termguicolors = true
|
||||
opt.background = "dark" -- colorschemes that can be light or dark will be made dark
|
||||
opt.signcolumn = "yes" -- show sign column so that text doesn't shift
|
||||
|
||||
-- backspace
|
||||
opt.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position
|
||||
|
||||
-- clipboard
|
||||
opt.clipboard:append("unnamedplus") -- use system clipboard as default register
|
||||
|
||||
-- split windows
|
||||
opt.splitright = true -- split vertical window to the right
|
||||
opt.splitbelow = true -- split horizontal window to the bottom
|
||||
|
||||
-- turn off swapfile
|
||||
opt.swapfile = false
|
Loading…
Add table
Add a link
Reference in a new issue