This commit is contained in:
2023-05-24 05:22:31 +02:00
parent 262a06776a
commit b933fbe1d9
13 changed files with 277 additions and 25 deletions
+3 -3
View File
@@ -10,9 +10,9 @@ M.ui = {
hl_add = {},
hl_override = {},
changed_themes = {},
theme_toggle = { "onedark", "one_light" },
theme = "onedark", -- default theme
transparency = false,
theme_toggle = { "gatekeeper", "one_light" },
theme = "gatekeeper", -- default theme
transparency = true,
lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens
-- https://github.com/NvChad/base46/tree/v2.0/lua/base46/extended_integrations
+6 -4
View File
@@ -6,7 +6,7 @@ local config = require("core.utils").load_config()
g.nvchad_theme = config.ui.theme
g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
g.toggle_theme_icon = ""
g.transparency = config.ui.transparency
g.transparency = true
-------------------------------------- options ------------------------------------------
opt.laststatus = 3 -- global statusline
@@ -17,10 +17,10 @@ opt.cursorline = true
-- Indenting
opt.expandtab = true
opt.shiftwidth = 2
opt.shiftwidth = 4
opt.smartindent = true
opt.tabstop = 2
opt.softtabstop = 2
opt.tabstop = 4
opt.softtabstop = 4
opt.fillchars = { eob = " " }
opt.ignorecase = true
@@ -31,6 +31,7 @@ opt.mouse = "a"
opt.number = true
opt.numberwidth = 2
opt.ruler = false
opt.relativenumber = true
-- disable nvim intro
opt.shortmess:append "sI"
@@ -92,6 +93,7 @@ vim.api.nvim_create_autocmd("BufWritePost", {
vim.g.nvchad_theme = config.ui.theme
vim.g.transparency = config.ui.transparency
vim.g.transparency = true
-- statusline
require("plenary.reload").reload_module("nvchad_ui.statusline." .. config.ui.statusline.theme)
+36 -16
View File
@@ -16,31 +16,41 @@ M.general = {
},
n = {
["<Esc>"] = { ":noh <CR>", "Clear highlights" },
["<leader>n"] = { ":noh <CR>", "Clear highlights" },
["<leader>rr"] = { ":source $MYVIMRC<CR>", "Reload config file" },
-- switch between windows
["<C-h>"] = { "<C-w>h", "Window left" },
["<C-l>"] = { "<C-w>l", "Window right" },
["<C-j>"] = { "<C-w>j", "Window down" },
["<C-k>"] = { "<C-w>k", "Window up" },
["<C-d>"] = { "<cmd> tab Git diff %<CR>", "Git diff this file" },
["<C-p>"] = { "<cmd> tab Git diff<CR>", "Git diff global" },
-- save
["<C-s>"] = { "<cmd> w <CR>", "Save file" },
-- Copy all
["<C-c>"] = { "<cmd> %y+ <CR>", "Copy whole file" },
-- ["<C-c>"] = { "<cmd> %y+ <CR>", "Copy whole file" },
-- Quit
["<C-q>"] = { "<cmd> q! <CR>", "Force quit window" },
-- line numbers
["<leader>n"] = { "<cmd> set nu! <CR>", "Toggle line number" },
["<leader>rn"] = { "<cmd> set rnu! <CR>", "Toggle relative number" },
-- ["<leader>n"] = { "<cmd> set nu! <CR>", "Toggle line number" },
-- ["<leader>rn"] = { "<cmd> set rnu! <CR>", "Toggle relative number" },
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/
-- empty mode is same as using <cmd> :map
-- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
-- ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
-- ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
-- ["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
-- ["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
["<leader>y"] = {"<cmd> :w! /tmp/vimtmp<CR>", "Save into a global tmp file"},
["<leader>p"] = {"<cmd> :r! cat /tmp/vimtmp<CR>", "Restore from the global tmp file"},
-- new buffer
["<leader>b"] = { "<cmd> enew <CR>", "New buffer" },
@@ -52,19 +62,29 @@ M.general = {
},
v = {
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
-- ["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
-- ["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
},
x = {
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
-- ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
-- ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
-- Don't copy the replaced text after pasting in visual mode
-- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste
["p"] = { 'p:let @+=@0<CR>:let @"=@0<CR>', "Dont copy replaced text", opts = { silent = true } },
},
}
M.gitstuffs = {
n = {
["<C-c>"] = { "<cmd> vertical topleft Git <bar> vertical resize 50<CR>", "Show Git status on a left pane" },
["<F3>"] = { "<cmd> Flog -all<CR>", "Show git tree" },
["<C-t>"] = { "<cmd> TagbarToggle<CR>", "Show tagbar" },
}
}
M.tabufline = {
plugin = true,
@@ -259,10 +279,10 @@ M.telescope = {
n = {
-- find
["<leader>ff"] = { "<cmd> Telescope find_files <CR>", "Find files" },
["<leader>fa"] = { "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <CR>", "Find all" },
["<leader>fw"] = { "<cmd> Telescope live_grep <CR>", "Live grep" },
["<leader>fb"] = { "<cmd> Telescope buffers <CR>", "Find buffers" },
["<C-g>"] = { "<cmd> Telescope find_files <CR>", "Find files" },
["<C-x>"] = { "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <CR>", "Find all" },
["<C-f>"] = { "<cmd> Telescope live_grep <CR>", "Live grep" },
["<C-b>"] = { "<cmd> Telescope buffers <CR>", "Find buffers" },
["<leader>fh"] = { "<cmd> Telescope help_tags <CR>", "Help page" },
["<leader>fo"] = { "<cmd> Telescope oldfiles <CR>", "Find oldfiles" },
["<leader>fz"] = { "<cmd> Telescope current_buffer_fuzzy_find <CR>", "Find in current buffer" },