diff --git a/init.lua b/init.lua index 8804de4..bf32cef 100644 --- a/init.lua +++ b/init.lua @@ -2,7 +2,7 @@ require("user.options") require("user.keymaps") require("user.plugins") -vim.cmd.colorscheme("catppuccin-mocha") +vim.cmd.colorscheme("tokyonight-storm") require("nvim-treesitter.configs").setup({ highlight = { enable = true }, diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index eeab5f5..a6aaf73 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -1,6 +1,100 @@ vim.g.mapleader = " " -local keymap = vim.keymap.set +local map = vim.keymap.set +local opts = { noremap = true, silent = true } -keymap("n", "pv", vim.cmd.Ex) -keymap("n", "", ":w", { desc = "Save file" }) -keymap("i", "jk", "") +map("n", "pv", vim.cmd.Ex) +map("n", "w", ":w", { desc = "Save file" }) +map("i", "jj", "") + + +map("i", "jj", "", { desc = "Go to normal mode" }) +map("n", "w", "write", { desc = "Save file" }) + +-- Placeholder: Replace with actual function if needed +-- map("v", "", function() alternative_file.open("next", "--exists") end) + +-- Buffer management +map("n", "Q", "q!", opts) +map("n", "q", "bdelete", opts) +map("n", "bdd", "bdelete!", opts) +map("n", "bda", "bufdo %bd!", opts) + +-- Notes +map("n", "et", ":e ~/.tmp/notes/", opts) +map("n", "on", ":e ~/.tmp/notes/notes.md", opts) +map("n", "con", ":e ~/.tmp/notes/notes.md", opts) + +-- Terminal escape +map("t", "", "", opts) +map("t", "jj", "", opts) + +-- Search +map("n", "f", "/", opts) +map("n", "F", "nohlsearch", opts) + +-- Quickfix +map("n", "gn", ":cnext", opts) +map("n", "gp", ":cprev", opts) + +-- Buffer navigation +map("n", "bn", ":bn", opts) +map("n", "bp", ":bp", opts) +map("n", "b", ":b", opts) + +-- Select all +map("n", "a", "ggVG", opts) + +-- Tabs +map("n", "t", ":tabnew", opts) + +-- Insert helpers +map("i", ",e", "/[\\]})\"']:nohlsearcha", opts) +map("i", "", "=>", opts) + +-- Hashrocket +map("v", "h", [[:s/\:\([a-zA-Z_]\+\)\s\+=>/\=printf("%s:", submatch(1))/g:let @/ = ""]], opts) + +-- Quit +map("n", "qq", ":q", opts) + +-- Reload +map("n", "rel", ":e", opts) + +-- File finder (stub) +map("n", "*", ":find", opts) + +-- Formatting +map("v", "Q", "gq", opts) +map("n", "Q", "gqap", opts) + +-- Resizing +map("n", "", "+", opts) +map("n", "", "-", opts) +map("n", "", "<", opts) +map("n", "", ">", opts) + +-- Make file executable +map("n", "xx", ":!chmod +x %", opts) + +-- Marks +map("n", "mA", "ma", opts) +map("n", "ma", "'a", opts) +map("n", "m1", "'a", opts) +map("n", "mB", "mb", opts) +map("n", "mb", "'b", opts) +map("n", "m2", "'b", opts) +map("n", "mC", "mc", opts) +map("n", "mc", "'c", opts) +map("n", "m3", "'c", opts) +map("n", "mD", "md", opts) +map("n", "md", "'d", opts) +map("n", "m4", "'d", opts) +map("n", "mE", "me", opts) +map("n", "me", "'e", opts) +map("n", "m5", "'e", opts) + +-- Open notes +map("n", "no", ":vs ~/.tmp/notes.md", opts) + +-- Open shell_test +map("n", "1", ":e shell_test", opts) diff --git a/lua/user/options.lua b/lua/user/options.lua index 169d232..74144db 100644 --- a/lua/user/options.lua +++ b/lua/user/options.lua @@ -9,3 +9,5 @@ vim.opt.cursorline = true vim.opt.signcolumn = "yes" vim.opt.updatetime = 300 vim.opt.scrolloff = 8 + + diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index c2f743f..3fa7563 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -13,4 +13,5 @@ require("lazy").setup({ { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, { "nvim-telescope/telescope.nvim", tag = "0.1.5" }, { "catppuccin/nvim", name = "catppuccin" }, + { "folke/tokyonight.nvim", lazy = false, priority = 1000, opts = {}, } })