diff options
Diffstat (limited to '')
| -rw-r--r-- | .config/Code/User/keybindings.json | 33 | ||||
| -rw-r--r-- | .config/chromium-flags.conf | 11 | ||||
| -rw-r--r-- | .config/nvim/init.lua | 87 |
3 files changed, 63 insertions, 68 deletions
diff --git a/.config/Code/User/keybindings.json b/.config/Code/User/keybindings.json index 945e24a..2bad03e 100644 --- a/.config/Code/User/keybindings.json +++ b/.config/Code/User/keybindings.json @@ -40,27 +40,6 @@ "command": "workbench.action.splitEditorDown", "when": "vim.active && vim.mode == 'Normal'" }, - // splits navigation - { - "key": "alt+h", - "command": "workbench.action.focusLeftGroup", - "when": "vim.active && vim.mode == 'Normal'" - }, - { - "key": "alt+j", - "command": "workbench.action.focusBelowGroup", - "when": "vim.active && vim.mode == 'Normal'" - }, - { - "key": "alt+k", - "command": "workbench.action.focusAboveGroup", - "when": "vim.active && vim.mode == 'Normal'" - }, - { - "key": "alt+l", - "command": "workbench.action.focusRightGroup", - "when": "vim.active && vim.mode == 'Normal'" - }, // alternate close { "key": "alt+q", @@ -189,7 +168,7 @@ "key": "shift+alt+m", "command": "workbench.action.toggleZenMode", "when": "editorFocus" - } + }, // panel navigation-ish { "key": "shift+alt+b j", @@ -286,5 +265,13 @@ { "key": "shift+alt+]", "command": "workbench.action.nextPanelView" + }, + { + "key": "alt+j", + "command": "workbench.action.nextEditor" + }, + { + "key": "alt+k", + "command": "workbench.action.previousEditor" } -]
\ No newline at end of file +] diff --git a/.config/chromium-flags.conf b/.config/chromium-flags.conf index ee5dba7..e155bc4 100644 --- a/.config/chromium-flags.conf +++ b/.config/chromium-flags.conf @@ -1,9 +1,2 @@ ---enable-zero-copy ---ignore-gpu-blocklist ---force-dark-mode ---disable-features=UseOzonePlatform,UseChromeOSDirectVideoDecoder,UseSkiaRenderer ---disable-gpu-driver-bug-workarounds ---disable-gpu-vsync ---enable-gpu-rasterization ---enable-features=VaapiVideoEncoder,VaapiVideoDecoder,WebUIDarkMode,CanvasOopRasterization,VaapiVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxGL ---disable-smooth-scrolling
\ No newline at end of file +--start-maximized +--disable-smooth-scrolling diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index a20e035..e2e65e4 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -10,7 +10,6 @@ vim.cmd [[ Plug 'junegunn/fzf' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' } - Plug 'Pocco81/true-zen.nvim' Plug 'neovim/nvim-lspconfig' Plug 'williamboman/mason.nvim' Plug 'williamboman/mason-lspconfig.nvim' @@ -19,10 +18,13 @@ vim.cmd [[ call plug#end() ]] +vim.g.NERDTreeShowHidden = 1 + -- options local opts = { autochdir = true, autoindent = true, + autoread = true, backup = false, cursorline = true, expandtab = true, @@ -64,6 +66,29 @@ if vim.env.TERM == "alacritty" then vim.opt.ttymouse = "sgr" end +-- custom functions for keymaps +local term_buf = nil +local toggle_terminal +toggle_terminal = function() + if term_buf and vim.fn.bufexists(term_buf) == 1 then + local win = vim.fn.bufwinnr(term_buf) + if win ~= -1 then + vim.cmd(win .. "close") + return + end + vim.cmd("belowright split") + vim.cmd("resize " .. math.floor(vim.o.lines / 3)) + vim.cmd("buffer " .. term_buf) + vim.cmd("startinsert") + return + end + vim.cmd("belowright split") + vim.cmd("resize " .. math.floor(vim.o.lines / 3)) + vim.cmd("terminal") + vim.cmd("startinsert") + term_buf = vim.api.nvim_get_current_buf() +end + -- custom keymaps local keymap = vim.keymap.set @@ -71,35 +96,34 @@ keymap("v", "<C-c>", '"+y', { noremap = true }) keymap("v", "<C-x>", '"+x', { noremap = true }) keymap({ "n", "v" }, "<C-p>", '"+p', { noremap = true }) keymap({ "n", "v" }, "<leader>p", '"+P', { noremap = true }) - keymap("n", "<C-d>", "<C-d>zz", { noremap = true }) keymap("n", "<C-u>", "<C-u>zz", { noremap = true }) keymap("n", "n", "nzzzv", { noremap = true }) keymap("n", "N", "Nzzzv", { noremap = true }) -keymap("n", "<leader>n", ":NERDTreeFocus<CR>", { noremap = true }) -keymap("n", "<C-n>", ":NERDTree<CR>", { noremap = true }) +keymap("n", "<S-A-b>h", ":NERDTreeToggle<CR>", { noremap = true }) +keymap("n", "<S-A-b><S-A-h>", ":NERDTreeToggle<CR>", { noremap = true }) keymap("n", "<A-n>", ":NERDTreeToggle<CR>", { noremap = true }) -keymap("n", "<leader>/", ":NERDTreeFind<CR>", { noremap = true }) - +keymap("n", "<S-A-j>", "<C-W>w", { noremap = true }) +keymap("n", "<S-A-k>", "<C-W>W", { noremap = true }) +keymap({"n", "t"}, "<S-A-b>j", function() toggle_terminal() end, { noremap = true }) +keymap({"n", "t"}, "<S-A-b><S-A-j>", function() toggle_terminal() end, { noremap = true }) keymap("n", "<leader>sc", ":set spell!<CR>", { noremap = true, silent = true }) -keymap("n", "<A-s>", "<C-W>v", { noremap = true }) -keymap("n", "<A-d>", "<C-W>s", { noremap = true }) +keymap("n", "<A-j>", ":bnext<CR>", { noremap = true, silent = true }) +keymap("n", "<A-k>", ":bprev<CR>", { noremap = true, silent = true }) + keymap("n", "<A-q>", "ZQ", { noremap = true }) keymap("n", "<A-z>", "ZZ", { noremap = true }) -keymap("n", "<A-j>", "<C-W>j", { noremap = true }) -keymap("n", "<A-k>", "<C-W>k", { noremap = true }) -keymap("n", "<A-l>", "<C-W>l", { noremap = true }) -keymap("n", "<A-h>", "<C-W>h", { noremap = true }) -keymap("n", "<A-e>", "<C-W>w", { noremap = true }) -keymap("n", "<A-w>", "<C-W>W", { noremap = true }) keymap("n", "<A-,>", "<C-W>5<", { noremap = true }) keymap("n", "<A-.>", "<C-W>5>", { noremap = true }) keymap("n", "<A-->", "<C-W>5-", { noremap = true }) keymap("n", "<A-=>", "<C-W>5+", { noremap = true }) +keymap("n", "<A-s>", ":vsplit<CR>", { noremap = true }) +keymap("n", "<A-d>", ":split<CR>", { noremap = true }) + keymap("n", "<A-t>", ":tabnew<CR>", { noremap = true }) keymap("n", "<A-[>", ":tabprev<CR>", { noremap = true }) keymap("n", "<A-]>", ":tabnext<CR>", { noremap = true }) @@ -126,6 +150,12 @@ vim.api.nvim_create_autocmd("BufWritePre", { command = [[%s/\s\+$//e]], }) +local autoread_group = vim.api.nvim_create_augroup("autoread", { clear = true }) +vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, { + group = autoread_group, + command = "if mode() !~ '\''[cCeEsS]'\'' | checktime | endif", +}) + vim.cmd("filetype plugin on") vim.cmd("filetype indent on") vim.cmd("syntax on") @@ -193,26 +223,6 @@ if tele_ok then end, {}) end --- truezen -local zen_ok, truezen = pcall(require, "true-zen") -if zen_ok then - keymap("n", "<leader>zn", function() - local first = 0 - local last = vim.api.nvim_buf_line_count(0) - truezen.narrow(first, last) - end, { noremap = true }) - - keymap("v", "<leader>zn", function() - local first = vim.fn.line("v") - local last = vim.fn.line(".") - truezen.narrow(first, last) - end, { noremap = true }) - - keymap("n", "<leader>zf", truezen.focus, { noremap = true }) - keymap("n", "<leader>zm", truezen.minimalist, { noremap = true }) - keymap("n", "<leader>za", truezen.ataraxis, { noremap = true }) -end - -- lsp vim.diagnostic.config({ update_in_insert = false, @@ -222,10 +232,13 @@ vim.diagnostic.config({ virtual_text = true, }) -keymap("n", "[d", vim.diagnostic.goto_prev, { desc = "diagnostic prev" }) -keymap("n", "]d", vim.diagnostic.goto_next, { desc = "diagnostic next" }) +keymap("n", "[d", function() vim.diagnostic.jump({ count = -1 }) end, { desc = "diagnostic prev" }) +keymap("n", "]d", function() vim.diagnostic.jump({ count = 1 }) end, { desc = "diagnostic next" }) keymap("n", "<leader>e", vim.diagnostic.open_float, { desc = "diagnostic float" }) +keymap("n", "<C-k><C-i>", vim.diagnostic.open_float, { desc = "diagnostic float" }) keymap("n", "<leader>q", vim.diagnostic.setloclist, { desc = "diagnostic list" }) +keymap("n", "<S-A-m>", vim.diagnostic.setloclist, { desc = "diagnostic list" }) + vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("user-lsp-attach", { clear = true }), @@ -243,6 +256,7 @@ vim.api.nvim_create_autocmd("LspAttach", { map("grd", vim.lsp.buf.definition, "definition") map("grt", vim.lsp.buf.type_definition, "type definition") map("K", vim.lsp.buf.hover, "hover") + map("<leader>F", function() vim.lsp.buf.format({ async = true }) end, "format", { "n", "x" }) local client = vim.lsp.get_client_by_id(event.data.client_id) if client and client:supports_method("textDocument/documentHighlight", event.buf) then @@ -279,6 +293,7 @@ local ok_tools, mason_tool_installer = pcall(require, "mason-tool-installer") -- put lsp servers here to ensure they are installed and configured local servers = { bashls = {}, + clangd = {}, dockerls = {}, docker_compose_language_service = {}, html = {}, |
