summaryrefslogtreecommitdiff
path: root/lua/ache/config
diff options
context:
space:
mode:
authorache <ache@ache.one>2024-07-21 05:30:30 +0200
committerache <ache@ache.one>2024-07-21 05:30:30 +0200
commitd69c281f43ba4168df32ef4ae6b77f88bfc60d86 (patch)
tree844fe20b45d099cbd35c1ccb3ae89dafb3da51a7 /lua/ache/config
Init commit
Diffstat (limited to 'lua/ache/config')
-rw-r--r--lua/ache/config/init.lua5
-rw-r--r--lua/ache/config/keymaps.lua36
-rw-r--r--lua/ache/config/options.lua41
3 files changed, 82 insertions, 0 deletions
diff --git a/lua/ache/config/init.lua b/lua/ache/config/init.lua
new file mode 100644
index 0000000..23d39b3
--- /dev/null
+++ b/lua/ache/config/init.lua
@@ -0,0 +1,5 @@
+require("ache.config.options")
+require("ache.config.keymaps")
+
+
+-- TODO: Try signcolumn=number
diff --git a/lua/ache/config/keymaps.lua b/lua/ache/config/keymaps.lua
new file mode 100644
index 0000000..1fd1125
--- /dev/null
+++ b/lua/ache/config/keymaps.lua
@@ -0,0 +1,36 @@
+vim.g.mapleader = "!"
+
+-- vim.keymap.set(mode, lhs, rhs, opts?)
+-- mode is:
+-- n => normal mode
+vim.keymap.set("n", "//", ":nohls<CR>", { desc = "clear search highlights" })
+vim.keymap.set("n", "cd", ":cd ", { desc = "change directory" })
+
+-- command alias => ca
+vim.keymap.set("ca", "tn", "tabnew")
+
+-- Make some unvisible chars visible.
+vim.opt.list = true
+vim.opt.listchars = {
+ tab = "› ",
+ -- lead = '·', -- lead is just an invisible normal space
+ trail = "ꞏ",
+ extends = "♯",
+ eol = "¬",
+ nbsp = "⍽",
+}
+
+vim.keymap.set("n", "<space><return>", ":w<return>", { desc = "quick save file" })
+
+-- Number increment
+-- It's c-a for Add ! and c-x to decress ! But since you just can't remenber ...
+vim.keymap.set("n", "<leader>+", "<c-a>", { desc = "Increment number" })
+vim.keymap.set("n", "<leader>-", "<c-x>", { desc = "Decrement number" })
+
+-- Window management
+-- Just use <c-w> !
+
+-- Tab navigation
+vim.keymap.set("n", "t<tab>", "<cmd>tabnext<CR>", { desc = "Go to next tab" })
+vim.keymap.set("n", "t<s-tab>", "<cmd>tabp<CR>", { desc = "Go to previous tab" })
+vim.keymap.set("n", "<leader>gt", "<cmd>tabnew %<CR>", { desc = "Open current buffer into a new tab" })
diff --git a/lua/ache/config/options.lua b/lua/ache/config/options.lua
new file mode 100644
index 0000000..c2a8d86
--- /dev/null
+++ b/lua/ache/config/options.lua
@@ -0,0 +1,41 @@
+vim.cmd("let g:netrw_liststyle = 3")
+
+local opt = {
+ -- Numbering
+ relativenumber = true,
+ number = true,
+
+ -- tabs & indentation
+ tabstop = 2, -- a tab is 2 spaces width
+ shiftwidth = 2, -- 2 spaces to indent
+ expandtab = true, -- transform tab to space. Use <C-v><Tab> to insert tab.
+ autoindent = true, -- copy indent from current line when starting new one
+
+ -- Long line management.
+ wrap = true,
+
+ -- search
+ ignorecase = true, -- ignore case when typing but ⤵
+ smartcase = true, -- mixed case in search imply case-sensitive search
+
+ cursorline = true,
+
+ -- turn on termguicolor for colorscheme to work
+ termguicolors = true,
+ -- background = "dark",
+ signcolumn = "yes:1", -- TODO: Try number !
+
+ -- split behavior
+ splitright = true,
+ splitbelow = true,
+
+ -- Use the system clipboard using external program like xsel
+ clipboard = "unnamedplus",
+
+ -- I fucking don't know
+ backspace = "indent,eol,start",
+}
+
+for k, v in pairs(opt) do
+ vim.opt[k] = v
+end