diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2023-09-24 04:42:06 -0400 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2023-09-24 04:42:06 -0400 |
commit | 4d358a5d49bf69a3a689c30ff425ccae19ec08d3 (patch) | |
tree | bd9bf0afbc5cc7a99ef9043513c3faf6fad40cc1 /lua/ben/core/init.lua | |
parent | adbe65a8bd41f17398a985d4c474ba7f907bb5d4 (diff) |
Update 2 to vim config
Diffstat (limited to 'lua/ben/core/init.lua')
-rw-r--r-- | lua/ben/core/init.lua | 70 |
1 files changed, 66 insertions, 4 deletions
diff --git a/lua/ben/core/init.lua b/lua/ben/core/init.lua index efdb794..e5bb0a2 100644 --- a/lua/ben/core/init.lua +++ b/lua/ben/core/init.lua @@ -1,14 +1,76 @@ -- My Personal Configurations: -- Superior leader key -vim.g.mapleader = ";" +vim.g.mapleader = ";" -- Space is quicker than Shift+Semicolon -vim.keymap.set('n', '<space>', ":") +vim.keymap.set("n", "<space>", ":") -- fm -> File Manager -vim.keymap.set('n', '<leader>fm', "<cmd>Exp<cr>") +vim.keymap.set("n", "<leader>fm", "<cmd>Exp<cr>") -- Tree View for the netrw File Manager vim.g.netrw_liststyle = 3 -vim.g.netrw_banner = 3 + +-- Set encoding to UTF-8 +vim.opt.encoding = "utf-8" + +-- Display all matching files when tab completing +vim.opt.wildmenu = true + +-- Don't show the previously typed command +vim.opt.shortmess:append("c") + +-- Set absolute and relative number hybrid +vim.opt.number = true +vim.opt.relativenumber = true + +-- View column count +vim.opt.ruler = true + +-- Disable the statusline +vim.opt.laststatus = 0 + +-- Sensible split directions +vim.opt.splitbelow = true +vim.opt.splitright = true + +-- Set tab width and shift width to 2 +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 + +-- Expanding tabs +vim.opt.expandtab = true + +-- Set fold method to marker for Vim folding +vim.opt.foldmethod = "marker" + +-- Spelling +vim.opt.complete:append("kspell") -- Better Spell Checking +vim.opt.spelllang = "fr" -- French prose + +-- Tag Editing +vim.api.nvim_set_keymap("i", "<leader>t", "<++>", { noremap = true }) +vim.api.nvim_set_keymap("i", "<leader>:", '<Esc>/<++><CR>"_c4l', { noremap = true }) + +-- Quickly save +vim.api.nvim_set_keymap("n", "<Leader>w", ":update<CR>", { silent = true }) + +-- Logical way to Yank +vim.api.nvim_set_keymap("n", "Y", "y$", {}) + +-- Easily escape terminal mode +vim.api.nvim_set_keymap("t", "<Esc>", "<C-\\><C-n>", {}) + +-- Split motion +vim.api.nvim_set_keymap("n", "<C-h>", "<C-w>h", {}) +vim.api.nvim_set_keymap("n", "<C-j>", "<C-w>j", {}) +vim.api.nvim_set_keymap("n", "<C-k>", "<C-w>k", {}) +vim.api.nvim_set_keymap("n", "<C-l>", "<C-w>l", {}) + +-- Saving and quitting buffers +vim.api.nvim_set_keymap("n", "ZF", "ZQ", {}) +vim.api.nvim_set_keymap("n", "<leader>w", ":update<CR>", { silent = true }) + +-- Remove trailing white spaces on BufWritePre +vim.cmd([[autocmd BufWritePre * %s/\s\+$//e]]) |