From 6739e1e280fc52d0cc48eb65cfdc2006a9e4d11d Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Sat, 26 Aug 2023 20:54:52 -0700 Subject: [PATCH] General updates --- minimal.vimrc.vim | 4 +-- nvim.init.lua | 66 ++++++++++++++++++++++++++++++----------------- wezterm.lua.mac | 12 ++++++--- 3 files changed, 52 insertions(+), 30 deletions(-) diff --git a/minimal.vimrc.vim b/minimal.vimrc.vim index 9af64d1..a8bee85 100644 --- a/minimal.vimrc.vim +++ b/minimal.vimrc.vim @@ -94,7 +94,7 @@ if has("nvim") else if has("mac") - set guifont=Iosevka-Term:h16 + set guifont=Iosevka-Term:h20 elseif has("win32") set guifont=Iosevka\ Term\ Regular\ 15 else @@ -104,7 +104,7 @@ set columns=120 lines=54 - " Hide/Show menu and tool bar + " Hide/Show menu and tool bar function! ToggleGUICruft() if &guioptions=='iaA' exec('set guioptions=imTrLaA') diff --git a/nvim.init.lua b/nvim.init.lua index 803430e..724a1b2 100644 --- a/nvim.init.lua +++ b/nvim.init.lua @@ -3,6 +3,7 @@ local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nv local is_bootstrap = false if vim.fn.empty(vim.fn.glob(install_path)) > 0 then is_bootstrap = true + vim.fn.system({'mkdir', '-p', install_path}) vim.fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) vim.cmd [[packadd packer.nvim]] end @@ -66,28 +67,6 @@ require('packer').startup(function(use) } } - -- Personal keymapping - vim.api.nvim_set_keymap('n', '', ':bn', { noremap = 1 }) - vim.api.nvim_set_keymap('v', '', ':bn', { noremap = 1 }) - vim.api.nvim_set_keymap('n', '', ':bp', { noremap = 1 }) - vim.api.nvim_set_keymap('n', '', ':e', { noremap = 1 }) - vim.api.nvim_set_keymap('n', '', 'w', { noremap = 1 }) - vim.api.nvim_set_keymap('n', '', 'W', { noremap = 1 }) -- S-F6 (F18 defined in ST's config.h) - vim.api.nvim_set_keymap('n', '', 'o', { noremap = 1 }) - vim.api.nvim_set_keymap('n', '', 'v', { noremap = 1 }) - vim.api.nvim_set_keymap('n', '', 's', { noremap = 1 }) -- S-F8 (F20 defined in ST's config.h) - vim.api.nvim_set_keymap('n', '', ':confirm bd', { noremap = 1 }) -- C-F11 (F35 defined in ST's config.h) - vim.api.nvim_set_keymap('v', '','"*ygv', { noremap = 1 }) -- Copy selection to clipboard - vim.api.nvim_set_keymap('v', '<2-LeftRelease>','"*ygv', { noremap = 1 }) -- Copy word selection to clipboard - vim.api.nvim_set_keymap('v', '<3-LeftRelease>','"*ygv', { noremap = 1 }) -- Copy line selection to clipboard - vim.api.nvim_set_keymap('v', '<4-LeftRelease>','"*ygv', { noremap = 1 }) -- Copy column selection to clipboard - vim.api.nvim_set_keymap('v', '', '"hy/h', { noremap = 1 }) -- Search selected text - vim.api.nvim_set_keymap('n', '', 'za', { noremap = 1 }) -- Toggle fold - vim.api.nvim_set_keymap('v', '<', '', '>gv', { noremap = 1 }) -- Preserve selection after right indent - vim.api.nvim_set_keymap('v', 'Q', 'gqap', { noremap = 1 }) -- Reflow visually highlighted lines with Q - vim.api.nvim_set_keymap('n', 'Q', 'gq', { noremap = 1 }) -- Reflow text - -- Nerd Tree (File navigation) use 'preservim/nerdtree' vim.api.nvim_set_keymap('n', '', ':NERDTreeToggle %', { noremap = 1 }) @@ -115,7 +94,16 @@ require('packer').startup(function(use) 'williamboman/mason-lspconfig.nvim', -- Useful status updates for LSP - 'j-hui/fidget.nvim', + {'j-hui/fidget.nvim', branch = 'legacy'}, + use { + 'j-hui/fidget.nvim', + tag = 'legacy', + config = function() + require("fidget").setup { + -- options + } + end, + } }, } @@ -188,12 +176,17 @@ vim.api.nvim_create_autocmd('BufWritePost', { -- [[ Setting options ]] -- See `:help vim.o` +if vim.g.neovide then + vim.o.guifont = "Iosevka Term:h16" +end + -- Set highlight on search vim.o.hlsearch = true -- Highlight problematic whitespace vim.o.list = true vim.opt.listchars = { tab = '▶ ', trail = '●', extends = '#', nbsp = '.' } +vim.o.wrap = false -- Make line numbers default vim.wo.number = true @@ -240,6 +233,31 @@ vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) 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 }) +-- Personal keymapping +vim.keymap.set('n', '', ':bn', { silent = true }) +vim.keymap.set('v', '', ':bn', { silent = true }) +vim.keymap.set('n', '', ':bp', { silent = true }) +vim.keymap.set('n', '', ':e', { silent = true }) +vim.keymap.set('n', '', 'w', { silent = true }) +vim.keymap.set('n', '', 'W', { silent = true }) -- S-F6 (F18 defined in ST's config.h) +vim.keymap.set('n', '', 'o', { silent = true }) +vim.keymap.set('n', '', 'v', { silent = true }) +vim.keymap.set('n', '', 's', { silent = true }) -- S-F8 (F20 defined in ST's config.h) +vim.keymap.set('n', '', ':confirm bd', { silent = true }) -- C-F11 (F35 defined in ST's config.h) +vim.keymap.set('v', '','"*ygv', { silent = true }) -- Copy selection to clipboard +vim.keymap.set('v', '<2-LeftRelease>','"*ygv', { silent = true }) -- Copy word selection to clipboard +vim.keymap.set('v', '<3-LeftRelease>','"*ygv', { silent = true }) -- Copy line selection to clipboard +vim.keymap.set('v', '<4-LeftRelease>','"*ygv', { silent = true }) -- Copy column selection to clipboard +vim.keymap.set('v', '', '"hy/h', { silent = true }) -- Search selected text +vim.keymap.set('n', '', 'za', { silent = true }) -- Toggle fold +vim.keymap.set('v', '<', '', '>gv', { silent = true }) -- Preserve selection after right indent +vim.keymap.set('v', 'Q', 'gqap', { silent = true }) -- Reflow visually highlighted lines with Q +vim.keymap.set('n', 'Q', 'gq', { silent = true }) -- Reflow text + +vim.keymap.set('n', 'td', 'a[=strftime("%Y/%m/%d")] ', { silent = true }) -- Insert Date after cursor +vim.keymap.set('n', 'tt', 'a[=strftime("%Y/%m/%d %X")] ', { silent = true }) -- Insert Date and time after cursor + -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) @@ -303,7 +321,7 @@ vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { de -- See `:help nvim-treesitter` require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'help', 'perl', 'ruby', 'verilog' }, + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'perl', 'ruby', 'verilog' }, highlight = { enable = true }, indent = { enable = true }, diff --git a/wezterm.lua.mac b/wezterm.lua.mac index 4b1cb14..2736de5 100644 --- a/wezterm.lua.mac +++ b/wezterm.lua.mac @@ -7,7 +7,7 @@ return { -- MacBook Pro setting with proper DPI font = wezterm.font("Iosevka Term"), font_size = 18, - font_antialias = "Subpixel", + -- font_antialias = "Subpixel", dpi = 144.0, -- Don't want tabbar by default @@ -16,6 +16,10 @@ return { -- Native fullscreen behavior on MacOS native_macos_fullscreen_mode = true, + -- -- Acceleration + -- front_end = "WebGpu", + -- webgpu_power_preference = "HighPerformance", + -- Keyboard bindings keys = { { key = 'f', mods = 'CMD|CTRL', action = wezterm.action.ToggleFullScreen, }, @@ -26,7 +30,7 @@ return { cursor_bg = "red", cursor_fg = "black", cursor_border = "grey", - compose_curspr = "orange", + compose_cursor = "orange", -- Color scheme -- Molokini (https://github.com/asolkar/vim-color-molokini/blob/master/colors/molokini.vim) @@ -34,7 +38,7 @@ return { ansi = { "#000000", "#F92672", "#A6E22E", "#FFDF5F", "#66D9EF", "#7070F0", "#A1FFA4", "#ffffff" }, - bright = { "#808080", "#f51d5a", "#9EC400", "#E7C547", - "#7AA6DA", "#B77EE0", "#54AE96", "#ffffff" }, + brights = { "#808080", "#f51d5a", "#9EC400", "#E7C547", + "#7AA6DA", "#B77EE0", "#54AE96", "#ffffff" }, } }