diff --git a/init.lua b/init.lua index 3d944766..5facab98 100644 --- a/init.lua +++ b/init.lua @@ -5,7 +5,6 @@ ===================================================================== Kickstart.nvim is *not* a distribution. - Kickstart.nvim is a template for your own configuration. The goal is that you can read every line of code, top-to-bottom, understand what your configuration is doing, and modify it to suit your needs. @@ -155,7 +154,7 @@ require('lazy').setup({ opts = { options = { icons_enabled = false, - theme = 'onedark', + theme = 'powerline', component_separators = '|', section_separators = '', }, @@ -227,7 +226,8 @@ require('lazy').setup({ vim.o.hlsearch = false -- Make line numbers default -vim.wo.number = true +vim.o.number = true +vim.o.relativenumber = true -- Enable mouse mode vim.o.mouse = 'a' @@ -240,9 +240,26 @@ vim.o.clipboard = 'unnamedplus' -- Enable break indent vim.o.breakindent = true --- Save undo history +-- Indent Configuration +vim.o.tabstop = 4 +vim.o.softtabstop = 4 +vim.o.shiftwidth = 4 +vim.o.expandtab = true + +vim.o.smartindent = true + +-- Disable line wrap +vim.o.wrap = false + +-- Save undo history_list +vim.o.swapfile = false +vim.o.backup = false +vim.o.undodir = os.getenv("HOME") .. "/.vim/undodir" vim.o.undofile = true +-- Searching Configuration +vim.o.incsearch = true + -- Case-insensitive searching UNLESS \C or capital in search vim.o.ignorecase = true vim.o.smartcase = true @@ -251,7 +268,7 @@ vim.o.smartcase = true vim.wo.signcolumn = 'yes' -- Decrease update time -vim.o.updatetime = 250 +vim.o.updatetime = 50 vim.o.timeoutlen = 300 -- Set completeopt to have a better completion experience @@ -260,17 +277,49 @@ vim.o.completeopt = 'menuone,noselect' -- NOTE: You should make sure your terminal supports this vim.o.termguicolors = true +vim.o.scrolloff = 10 +-- vim.o.isfname:append("@-@") + +vim.o.colorcolumn = "80" + -- [[ Basic Keymaps ]] -- Keymaps for better default experience -- See `:help vim.keymap.set()` vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) -vim.keymap.set('n', 'pv', vim.cmd.Ex) +vim.keymap.set('n', 'pv', vim.cmd.Ex, { desc = "[P]roject [V]iew"}) -- Remap for dealing with word wrap vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +-- Move lines +-- +vim.keymap.set('v', 'J', ":m '>+1gv=gv") +vim.keymap.set('v', 'K', ":m '<-2gv=gv") + +vim.keymap.set('n', 'J', "mzj`z") +vim.keymap.set('n', '', "zz") +vim.keymap.set('n', '', "zz") + +-- Keep search line in the middle +vim.keymap.set('n', 'n', 'nzzzv') +vim.keymap.set('n', 'N', 'Nzzzv') + +-- Quick fix navigation +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +-- Copy from plus register +vim.keymap.set({ 'n', 'v' }, 'y', "\"+y") +vim.keymap.set('n', 'Y', "\"+Y") + +-- Replace current word +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) + -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })