Improve file structure
This commit is contained in:
49
init.lua
49
init.lua
@ -2,49 +2,12 @@
|
|||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = " "
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
-- Load options first
|
||||||
|
require("config.options")
|
||||||
|
|
||||||
|
-- Load keymaps
|
||||||
|
require("config.keymaps")
|
||||||
|
|
||||||
-- Load lazy.nvim
|
-- Load lazy.nvim
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
|
|
||||||
-- Line numbers
|
|
||||||
vim.opt.number = true
|
|
||||||
vim.opt.relativenumber = true
|
|
||||||
|
|
||||||
-- Tabs & indentation
|
|
||||||
vim.opt.tabstop = 4 -- number of spaces a tab counts for
|
|
||||||
vim.opt.shiftwidth = 4 -- spaces for each indent
|
|
||||||
vim.opt.expandtab = true -- convert tabs to spaces
|
|
||||||
vim.opt.smartindent = true
|
|
||||||
|
|
||||||
-- Searching
|
|
||||||
vim.opt.ignorecase = true -- case-insensitive search...
|
|
||||||
vim.opt.smartcase = true -- ...unless you use capitals
|
|
||||||
vim.opt.hlsearch = true
|
|
||||||
vim.opt.incsearch = true
|
|
||||||
|
|
||||||
-- UI / UX
|
|
||||||
vim.opt.termguicolors = true
|
|
||||||
vim.opt.cursorline = true
|
|
||||||
vim.opt.signcolumn = "yes" -- avoid text shifting
|
|
||||||
vim.opt.wrap = false -- no line wrapping
|
|
||||||
|
|
||||||
-- Behavior
|
|
||||||
vim.opt.scrolloff = 8 -- keep lines above/below cursor
|
|
||||||
vim.opt.sidescrolloff = 8
|
|
||||||
vim.opt.updatetime = 300 -- faster diagnostics
|
|
||||||
vim.opt.timeoutlen = 500 -- faster key sequences
|
|
||||||
|
|
||||||
-- Clipboard (use system clipboard)
|
|
||||||
vim.opt.clipboard = "unnamedplus"
|
|
||||||
|
|
||||||
-- Save & quit
|
|
||||||
vim.keymap.set("n", "<leader>w", ":w<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>q", ":q<CR>")
|
|
||||||
|
|
||||||
-- Clear search highlight
|
|
||||||
vim.keymap.set("n", "<leader>h", ":nohlsearch<CR>")
|
|
||||||
|
|
||||||
-- Better window navigation
|
|
||||||
vim.keymap.set("n", "<C-h>", "<C-w>h")
|
|
||||||
vim.keymap.set("n", "<C-j>", "<C-w>j")
|
|
||||||
vim.keymap.set("n", "<C-k>", "<C-w>k")
|
|
||||||
vim.keymap.set("n", "<C-l>", "<C-w>l")
|
|
||||||
|
|||||||
4
lazy-lock.json
Normal file
4
lazy-lock.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
|
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }
|
||||||
|
}
|
||||||
12
lua/config/keymaps.lua
Normal file
12
lua/config/keymaps.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
-- Save & quit
|
||||||
|
vim.keymap.set("n", "<leader>w", ":w<CR>")
|
||||||
|
vim.keymap.set("n", "<leader>q", ":q<CR>")
|
||||||
|
|
||||||
|
-- Clear search highlight
|
||||||
|
vim.keymap.set("n", "<leader>h", ":nohlsearch<CR>")
|
||||||
|
|
||||||
|
-- Better window navigation
|
||||||
|
vim.keymap.set("n", "<C-h>", "<C-w>h")
|
||||||
|
vim.keymap.set("n", "<C-j>", "<C-w>j")
|
||||||
|
vim.keymap.set("n", "<C-k>", "<C-w>k")
|
||||||
|
vim.keymap.set("n", "<C-l>", "<C-w>l")
|
||||||
@ -18,6 +18,13 @@ vim.opt.rtp:prepend(lazypath)
|
|||||||
|
|
||||||
-- Initialize lazy.nvim
|
-- Initialize lazy.nvim
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
-- plugins will go here
|
{
|
||||||
|
"folke/tokyonight.nvim",
|
||||||
|
lazy = false, -- load immediately
|
||||||
|
priority = 1000, -- load before other plugins
|
||||||
|
config = function()
|
||||||
|
vim.cmd("colorscheme tokyonight")
|
||||||
|
end,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
30
lua/config/options.lua
Normal file
30
lua/config/options.lua
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
-- Line numbers
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
|
-- Tabs & indentation
|
||||||
|
vim.opt.tabstop = 4 -- number of spaces a tab counts for
|
||||||
|
vim.opt.shiftwidth = 4 -- spaces for each indent
|
||||||
|
vim.opt.expandtab = true -- convert tabs to spaces
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
|
||||||
|
-- Searching
|
||||||
|
vim.opt.ignorecase = true -- case-insensitive search...
|
||||||
|
vim.opt.smartcase = true -- ...unless you use capitals
|
||||||
|
vim.opt.hlsearch = true
|
||||||
|
vim.opt.incsearch = true
|
||||||
|
|
||||||
|
-- UI / UX
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.signcolumn = "yes" -- avoid text shifting
|
||||||
|
vim.opt.wrap = false -- no line wrapping
|
||||||
|
|
||||||
|
-- Behavior
|
||||||
|
vim.opt.scrolloff = 8 -- keep lines above/below cursor
|
||||||
|
vim.opt.sidescrolloff = 8
|
||||||
|
vim.opt.updatetime = 300 -- faster diagnostics
|
||||||
|
vim.opt.timeoutlen = 500 -- faster key sequences
|
||||||
|
|
||||||
|
-- Clipboard (use system clipboard)
|
||||||
|
vim.opt.clipboard = "unnamedplus"
|
||||||
Reference in New Issue
Block a user