From 6790f75c8aaf4dbc64d5d6c4e02516afafc49762 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 10 Oct 2024 21:17:54 +0200 Subject: [PATCH] General changes + vim changes --- .config/i3/config | 5 +- .config/kitty/current-theme.conf | 69 ++++++++++---------------- .config/kitty/kitty.conf | 6 +-- .config/kitty/kitty.conf.bak | 20 +++++--- .config/nvim/init.lua | 10 ++-- .config/nvim/lazy-lock.json | 38 +++++++------- .config/nvim/lua/BluePlum/keymap.lua | 36 ++++++++++++++ .config/nvim/lua/BluePlum/neovide.lua | 24 +++++++++ .config/nvim/lua/BluePlum/set.lua | 19 +++++++ .config/nvim/lua/BluePlum/utility.lua | 53 ++++++++++++++++++++ .config/nvim/lua/lsp.lua | 32 +++--------- .config/nvim/lua/plugins/comp-mode.lua | 23 +++++++++ .config/nvim/lua/plugins/theme.lua | 9 ++-- .zshrc | 3 ++ zsh/aliases.sh | 3 ++ zsh/completion.sh | 7 ++- zsh/functions.sh | 19 +++++++ zsh/git.sh | 27 ---------- zsh/plugins.sh | 1 - zsh/prompt.sh | 7 ++- 20 files changed, 273 insertions(+), 138 deletions(-) create mode 100644 .config/nvim/lua/BluePlum/neovide.lua create mode 100644 .config/nvim/lua/BluePlum/utility.lua create mode 100644 .config/nvim/lua/plugins/comp-mode.lua delete mode 100644 zsh/git.sh diff --git a/.config/i3/config b/.config/i3/config index 697f845..7b4e999 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -60,11 +60,14 @@ tiling_drag modifier titlebar bindsym $mod+Return exec kitty # start an app -bindsym $mod+n exec kitty -- ldesk && exit +bindsym $mod+n exec kitty -- fzf-launcher && exit # kill focused window bindsym $mod+q kill +# Enable compose key with caps lock +exec setxkbmap -option compose:caps + # start dmenu (a program launcher) # bindsym $mod+d exec --no-startup-id dmenu_run # A more modern dmenu replacement is rofi: diff --git a/.config/kitty/current-theme.conf b/.config/kitty/current-theme.conf index 25681d6..b93d4a8 100644 --- a/.config/kitty/current-theme.conf +++ b/.config/kitty/current-theme.conf @@ -1,47 +1,32 @@ -background #222222 -foreground #f7f1ff +## name: Gruvbox Dark +## author: Pavel Pertsev +## license: MIT/X11 +## upstream: https://raw.githubusercontent.com/gruvbox-community/gruvbox-contrib/master/kitty/gruvbox-dark.conf -cursor #f7f1ff -cursor_text_color #000000 -selection_foreground #363537 -selection_background #f7f1ff +selection_foreground #ebdbb2 +selection_background #d65d0e -# dull black -color0 #363537 -# light black -color8 #69676c +background #282828 +foreground #ebdbb2 -# dull red -color1 #fc618d -# light red -color9 #fc618d +color0 #3c3836 +color1 #cc241d +color2 #98971a +color3 #d79921 +color4 #458588 +color5 #b16286 +color6 #689d6a +color7 #a89984 +color8 #928374 +color9 #fb4934 +color10 #b8bb26 +color11 #fabd2f +color12 #83a598 +color13 #d3869b +color14 #8ec07c +color15 #fbf1c7 -# dull green -color2 #7bd88f -# light green -color10 #7bd88f +cursor #bdae93 +cursor_text_color #665c54 -# yellow -color3 #fce566 -# light yellow -color11 #fce566 - -# blue -color4 #fd9353 -# light blue -color12 #fd9353 - -# magenta -color5 #948ae3 -# light magenta -color13 #948ae3 - -# cyan -color6 #5ad4e6 -# light cyan -color14 #5ad4e6 - -# dull white -color7 #f7f1ff -# bright white -color15 #f7f1ff +url_color #458588 diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index ccd7ce4..16fd757 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -24,7 +24,7 @@ bold_italic_font JetBrains Mono Bold Italic #: italic_font Operator Mono Book Italic #: bold_italic_font Operator Mono Medium Italic -font_size 12.0 +font_size 12 #: Font size (in pts). @@ -302,7 +302,7 @@ cursor_blink_interval 0.5 #: disable blinking. Negative values mean use system default. Note #: that the minimum interval will be limited to repaint_delay. -# cursor_stop_blinking_after 15.0 +cursor_stop_blinking_after 10.0 #: Stop blinking cursor after the specified number of seconds of #: keyboard inactivity. Set to zero to never stop blinking. @@ -2530,6 +2530,6 @@ enable_audio_bell no # BEGIN_KITTY_THEME -# Monokai Pro (Filter Spectrum) +# Gruvbox Dark include current-theme.conf # END_KITTY_THEME diff --git a/.config/kitty/kitty.conf.bak b/.config/kitty/kitty.conf.bak index 267121b..0cbb485 100644 --- a/.config/kitty/kitty.conf.bak +++ b/.config/kitty/kitty.conf.bak @@ -6,10 +6,10 @@ #: individual font faces and even specify special fonts for particular #: characters. -font_family JetBrainsMonoNL NFM Regular -# bold_font auto -# italic_font auto -# bold_italic_font auto +font_family JetBrains Mono Regular +bold_font JetBrains Mono Bold +italic_font JetBrains Mono Italic +bold_italic_font JetBrains Mono Bold Italic #: You can specify different fonts for the bold/italic/bold-italic #: variants. To get a full list of supported fonts use the `kitty @@ -24,7 +24,7 @@ font_family JetBrainsMonoNL NFM Regular #: italic_font Operator Mono Book Italic #: bold_italic_font Operator Mono Medium Italic -font_size 12.0 +font_size 12 #: Font size (in pts). @@ -302,7 +302,7 @@ cursor_blink_interval 0.5 #: disable blinking. Negative values mean use system default. Note #: that the minimum interval will be limited to repaint_delay. -# cursor_stop_blinking_after 15.0 +cursor_stop_blinking_after 10.0 #: Stop blinking cursor after the specified number of seconds of #: keyboard inactivity. Set to zero to never stop blinking. @@ -734,7 +734,7 @@ cursor_blink_interval 0.5 #: Terminal bell {{{ -# enable_audio_bell yes +enable_audio_bell no #: The audio bell. Useful to disable it in environments that require #: silence. @@ -2527,3 +2527,9 @@ cursor_blink_interval 0.5 #: }}} #: }}} + + +# BEGIN_KITTY_THEME +# Monokai Pro (Filter Spectrum) +include current-theme.conf +# END_KITTY_THEME diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 5504635..9f75e1d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -17,18 +17,16 @@ vim.opt.rtp:prepend(lazypath) require('BluePlum.set') require('BluePlum.keymap') - --- Lualine filename -local function hello() - return [[hello world]] -end +require('BluePlum.neovide') +require('BluePlum.utility') require('lazy').setup({ -- Plugins spec = { { import = 'plugins' }, }, - checker = { enabled = true }, + checker = { enabled = false }, + change_detection = { notify = false }, }) require('lsp') diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 660a66d..8a8d90b 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,29 +1,31 @@ { - "LuaSnip": { "branch": "master", "commit": "7552e6504ee95a9c8cfc6db53e389122ded46cd4" }, + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, "actions-preview.nvim": { "branch": "master", "commit": "9f52a01c374318e91337697ebed51c6fae57f8a4" }, + "baleia.nvim": { "branch": "main", "commit": "1b25eac3ac03659c3d3af75c7455e179e5f197f7" }, "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" }, + "compile-mode.nvim": { "branch": "main", "commit": "2bf8381871bf7a9dad347938ddef6b09a1735bdb" }, + "dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" }, "formatter.nvim": { "branch": "fix-305-index-out-of-bounds", "commit": "a8a8b196c9ca37afa53f7ee30a98a343bbbca325" }, + "gruber-darker.nvim": { "branch": "main", "commit": "a2dda61d9c1225e16951a51d6b89795b0ac35cd6" }, "inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" }, - "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "56db3d5ce5476b183783160e6045f7337ba12b83" }, - "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, - "lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" }, - "markview.nvim": { "branch": "main", "commit": "d0ccc97b5c988fb28e5033abdf7b832b9dfaf897" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "fd69d5c782a28420d51b648a3d7fe88df569d391" }, + "lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" }, + "lspkind.nvim": { "branch": "master", "commit": "59c3f419af48a2ffb2320cea85e44e5a95f71664" }, + "markview.nvim": { "branch": "main", "commit": "67b69cdaf9055bebac3682a070d7e5c8eecba29c" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "monokai-pro.nvim": { "branch": "master", "commit": "2bad2a92fe0ff6c8581d33a853a1b17592b83239" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "e6528f4613c8db2e04be908eb2b5886d63f62a98" }, - "nvim-treesitter": { "branch": "master", "commit": "d7353a6b72008b38aa873ace49aa97bea257941b" }, - "nvim-ufo": { "branch": "main", "commit": "4cc3ba9303c0708b81fd681786a4835fd31518ac" }, - "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, - "oil.nvim": { "branch": "master", "commit": "fcca212c2e966fc3dec1d4baf888e670631d25d1" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, - "promise-async": { "branch": "main", "commit": "038d05664fedc920ba86720214c84a15ff7432b0" }, - "rustaceanvim": { "branch": "master", "commit": "7da155a907e3f48b1f7c25c59e248996fba833df" }, - "telescope.nvim": { "branch": "master", "commit": "3b1600d0fd5172ad9fae00987362ca0ef3d8895d" }, - "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" } + "nvim-lspconfig": { "branch": "master", "commit": "ff69ecca55d83ffc70657f260a799f79a5637831" }, + "nvim-treesitter": { "branch": "master", "commit": "9b1e607298dd5fc2ee6549488324cc92dafb99c0" }, + "nvim-ufo": { "branch": "main", "commit": "203c9f434feec57909ab4b1e028abeb3349b7847" }, + "nvim-web-devicons": { "branch": "master", "commit": "56f17def81478e406e3a8ec4aa727558e79786f3" }, + "oil.nvim": { "branch": "master", "commit": "ccab9d5e09e2d0042fbbe5b6bd05e82426247067" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, + "rustaceanvim": { "branch": "master", "commit": "d1f56672638508a7bc971cde31a29df4018579a9" }, + "telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" } } diff --git a/.config/nvim/lua/BluePlum/keymap.lua b/.config/nvim/lua/BluePlum/keymap.lua index 95656dc..f7e0602 100644 --- a/.config/nvim/lua/BluePlum/keymap.lua +++ b/.config/nvim/lua/BluePlum/keymap.lua @@ -25,3 +25,39 @@ vim.keymap.set('n', 'l', ':e#') vim.keymap.set('n', 'i', 'cc') -- peek vim.keymap.set('n', 'p', vim.lsp.buf.hover) + +-- Scratch pad +vim.keymap.set( + 'n', + 's', + ':bo vs:enew:setlocal noswapfile:setlocal bufhidden=hide:setlocal buftype=nofile:set filetype=markdown:set syntax=markdown' +) + +-- Help +vim.cmd.cnoreabbrev('h vert h') + +-- Windows +vim.keymap.set('n', 'k', function() + if vim.bo.modified then + if Confirm('Buffer has unsaved changes; write?') then + vim.cmd.write() + vim.cmd.bdelete() + else + vim.cmd('bd!') + end + else + vim.cmd.bdelete() + end +end) + +-- Comp mode +vim.keymap.set('n', 's', function() -- s: start + local command = Input('Enter compilation command > ', vim.g.last_compile_command) + if command then + vim.g.last_compile_command = command + vim.cmd.Compile(command) + end +end) + +vim.keymap.set('n', 'E', ':NextError') +vim.keymap.set('n', 'S', ':Recompile') diff --git a/.config/nvim/lua/BluePlum/neovide.lua b/.config/nvim/lua/BluePlum/neovide.lua new file mode 100644 index 0000000..f10cf6b --- /dev/null +++ b/.config/nvim/lua/BluePlum/neovide.lua @@ -0,0 +1,24 @@ +if not vim.g.neovide then + return +end + +vim.o.guifont = 'Jetbrains Mono:h17' + +vim.g.neovide_underline_stroke_scale = 2.0 +vim.g.neovide_theme = 'dark' +vim.g.neovide_refresh_rate_idle = 10 +vim.g.neovide_transparency = 0.6 + +-- Scroll +vim.g.neovide_scroll_animation_length = 0.1 +vim.g.neovide_scroll_animation_far_lines = 50 + +-- Cursor +vim.g.neovide_cursor_animation_length = 0.03 +vim.g.neovide_cursor_trail_size = 0.5 +vim.g.neovide_cursor_smooth_blink = true +vim.cmd.set('guicursor=i-v-c:blinkwait400-blinkoff350-blinkon250,i-ci-ve:ver25,r-cr:hor20,o:hor20') + +-- Pasting +vim.keymap.set('i', '', '+') +vim.keymap.set('n', '', '"+p') diff --git a/.config/nvim/lua/BluePlum/set.lua b/.config/nvim/lua/BluePlum/set.lua index 1cf898d..99ce8d2 100644 --- a/.config/nvim/lua/BluePlum/set.lua +++ b/.config/nvim/lua/BluePlum/set.lua @@ -7,6 +7,8 @@ vim.opt.shiftwidth = 4 -- Line numbers vim.opt.number = true vim.opt.relativenumber = true +vim.opt.cursorline = true +vim.opt.cursorlineopt = 'number' -- Folding vim.opt.foldlevelstart = 99 @@ -19,3 +21,20 @@ vim.g.terminal_emulator = 'kitty' -- LSP vim.lsp.inlay_hint.enable() + +-- Splitting +-- vim.cmd.set('splitbelow') +-- vim.cmd.set('splitright') +vim.opt.splitright = true +vim.opt.splitbelow = true + +-- Make text readable +vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { + pattern = { '*.md', '*.typ' }, + command = 'setlocal linebreak', +}) + +vim.api.nvim_create_autocmd('FileType', { + pattern = 'help', + command = 'setlocal linebreak', +}) diff --git a/.config/nvim/lua/BluePlum/utility.lua b/.config/nvim/lua/BluePlum/utility.lua new file mode 100644 index 0000000..a9fc9ed --- /dev/null +++ b/.config/nvim/lua/BluePlum/utility.lua @@ -0,0 +1,53 @@ +function Ask(msg) + vim.cmd.echohl('Question') + vim.cmd.echo('"' .. msg .. '"') + vim.cmd.echohl() +end + +function Confirm(msg) + Ask(msg .. ' [Y/n] ') + + local answer = vim.fn.getchar() + return answer ~= 110 and answer ~= 27 and answer ~= 37 -- 'n', , +end + +function Input(prompt, last) + local buffer = '' + while true do + vim.cmd('redraw | echo') + vim.api.nvim_echo({ + { prompt, 'Question' }, + last and { last, 'Visual' } or { buffer, 'Normal' }, + }, false, {}) + + local character = vim.fn.getchar() + if pcall(function(char) + if vim.fn.keytrans(char) ~= '' then + error() + end + end, character) then + last = nil + buffer = vim.fn.slice(buffer, 0, -1) + elseif character == 27 then + vim.cmd('redraw | echo') + return nil + elseif character == 13 then + return last or buffer + elseif + (character == 32 or pcall(function(char) + if vim.fn.keytrans(char) ~= '' then + error() + end + end, character)) and last + then + buffer = last + if character == 32 then + buffer = buffer .. ' ' + end + last = nil + else + last = nil + buffer = buffer .. vim.fn.nr2char(character) + end + end +end diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 792041a..417866f 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -114,31 +114,13 @@ cmp.setup({ return kind end, - - -- format = function(entry, vim_item) - -- -- Kind icons - -- vim_item.kind = string.format('%s %s ', cmp_kind_icons[vim_item.kind], vim_item.kind) - -- - -- return vim_item - -- end, - - -- format = function(entry, item) - -- local menu_icon = { - -- nvim_lsp = 'λ', - -- luasnip = '⋗', - -- buffer = 'Ω', - -- path = '🖫', - -- } - - -- item.menu = menu_icon[entry.source.name] - -- return item - -- end }, }) -- #region Highlight groups -- Customization for Pmenu + vim.api.nvim_set_hl(0, 'PmenuSel', { bg = '#282C34', fg = 'NONE' }) vim.api.nvim_set_hl(0, 'Pmenu', { fg = '#C5CDD9', bg = '#22252A' }) @@ -151,9 +133,9 @@ vim.api.nvim_set_hl(0, 'CmpItemKindField', { fg = '#EED8DA', bg = '#B5585F' }) vim.api.nvim_set_hl(0, 'CmpItemKindProperty', { fg = '#EED8DA', bg = '#B5585F' }) vim.api.nvim_set_hl(0, 'CmpItemKindEvent', { fg = '#EED8DA', bg = '#B5585F' }) -vim.api.nvim_set_hl(0, 'CmpItemKindText', { fg = '#e2f3c9', bg = '#94c549' }) -vim.api.nvim_set_hl(0, 'CmpItemKindEnum', { fg = '#e2f3c9', bg = '#94c549' }) -vim.api.nvim_set_hl(0, 'CmpItemKindKeyword', { fg = '#e2f3c9', bg = '#94c549' }) +vim.api.nvim_set_hl(0, 'CmpItemKindText', { fg = '#C3E88D', bg = '#9FBD73' }) +vim.api.nvim_set_hl(0, 'CmpItemKindEnum', { fg = '#C3E88D', bg = '#9FBD73' }) +vim.api.nvim_set_hl(0, 'CmpItemKindKeyword', { fg = '#C3E88D', bg = '#9FBD73' }) vim.api.nvim_set_hl(0, 'CmpItemKindConstant', { fg = '#FFE082', bg = '#D4BB6C' }) vim.api.nvim_set_hl(0, 'CmpItemKindConstructor', { fg = '#FFE082', bg = '#D4BB6C' }) @@ -168,9 +150,9 @@ vim.api.nvim_set_hl(0, 'CmpItemKindOperator', { fg = '#EADFF0', bg = '#A377BF' } vim.api.nvim_set_hl(0, 'CmpItemKindVariable', { fg = '#C5CDD9', bg = '#7E8294' }) vim.api.nvim_set_hl(0, 'CmpItemKindFile', { fg = '#C5CDD9', bg = '#7E8294' }) -vim.api.nvim_set_hl(0, 'CmpItemKindUnit', { fg = '#F5EBD9', bg = '#D29a32' }) -vim.api.nvim_set_hl(0, 'CmpItemKindSnippet', { fg = '#F5EBD9', bg = '#D29a32' }) -vim.api.nvim_set_hl(0, 'CmpItemKindFolder', { fg = '#F5EBD9', bg = '#D29a32' }) +vim.api.nvim_set_hl(0, 'CmpItemKindUnit', { fg = '#F5EBD9', bg = '#D4A959' }) +vim.api.nvim_set_hl(0, 'CmpItemKindSnippet', { fg = '#F5EBD9', bg = '#D4A959' }) +vim.api.nvim_set_hl(0, 'CmpItemKindFolder', { fg = '#F5EBD9', bg = '#D4A959' }) vim.api.nvim_set_hl(0, 'CmpItemKindMethod', { fg = '#DDE5F5', bg = '#6C8ED4' }) vim.api.nvim_set_hl(0, 'CmpItemKindValue', { fg = '#DDE5F5', bg = '#6C8ED4' }) diff --git a/.config/nvim/lua/plugins/comp-mode.lua b/.config/nvim/lua/plugins/comp-mode.lua new file mode 100644 index 0000000..7ac8664 --- /dev/null +++ b/.config/nvim/lua/plugins/comp-mode.lua @@ -0,0 +1,23 @@ +return { + { + 'ej-shafran/compile-mode.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'm00qek/baleia.nvim', + }, + config = function() + vim.api.nvim_set_hl(0, 'CompileModeInfo', { link = 'DiagnosticInfo' }) + vim.api.nvim_set_hl(0, 'CompileModeWarning', { link = 'DiagnosticWarning' }) + vim.api.nvim_set_hl(0, 'CompileModeError', { link = 'DiagnosticError' }) + + vim.api.nvim_set_hl(0, 'CompileModeCommandOutput', { link = 'Statement' }) + vim.api.nvim_set_hl(0, 'CompileModeMessage', { link = 'SpellCap' }) + vim.api.nvim_set_hl(0, 'CompileModeMessageRow', { link = 'CursorLineNr' }) + vim.api.nvim_set_hl(0, 'CompileModeMessageCol', { link = 'CursorLineNr' }) + + vim.g.compile_mode = { + baleria_setup = true, + } + end, + }, +} diff --git a/.config/nvim/lua/plugins/theme.lua b/.config/nvim/lua/plugins/theme.lua index 3077b00..9765750 100644 --- a/.config/nvim/lua/plugins/theme.lua +++ b/.config/nvim/lua/plugins/theme.lua @@ -1,13 +1,10 @@ return { { - 'loctvl842/monokai-pro.nvim', - -- lazy = true, + 'blazkowolf/gruber-darker.nvim', priority = 999, config = function() - require('monokai-pro').setup({ - filter = 'spectrum', - }) - vim.cmd.colorscheme('monokai-pro') + -- require('gruber-darker').setup() + vim.cmd.colorscheme('gruber-darker') end, }, } diff --git a/.zshrc b/.zshrc index 0be974c..cb4a1c6 100644 --- a/.zshrc +++ b/.zshrc @@ -46,3 +46,6 @@ zinit ice wait'!0' # source ${ZINIT_HOME}/../plugins/marlonrichert---zsh-autocomplete/zsh-autocomplete.plugin.zsh # zstyle ':autocomplete:*' delay 0.1 # seconds (float) + +# Created by `pipx` on 2024-08-28 16:28:46 +export PATH="$PATH:/home/anton/.local/bin" diff --git a/zsh/aliases.sh b/zsh/aliases.sh index 6528b5e..2f7e105 100644 --- a/zsh/aliases.sh +++ b/zsh/aliases.sh @@ -16,3 +16,6 @@ alias ll='ls -l' # WG alias wgon='wg-quick up ~/Downloads/wg0.conf' alias wgoff='wg-quick down ~/Downloads/wg0.conf' + +# nvim +nv() { neovide $1 & } diff --git a/zsh/completion.sh b/zsh/completion.sh index 571bfde..ff7ce56 100644 --- a/zsh/completion.sh +++ b/zsh/completion.sh @@ -1,6 +1,11 @@ setopt interactivecomments # VERY IMPORTANT LINE! Completions will be very bad without it -zinit ice as"completion" +zstyle ':autocomplete:*' min-delay 0.5 # float +zstyle ':autocomplete:*' min-input 2 # int +zstyle ':autocomplete:*' insert-unambiguous no + +zinit ice as "autocomplete" zinit light zsh-users/zsh-completions zinit light marlonrichert/zsh-autocomplete + diff --git a/zsh/functions.sh b/zsh/functions.sh index 4c81df7..644c6a9 100644 --- a/zsh/functions.sh +++ b/zsh/functions.sh @@ -31,3 +31,22 @@ split() { (kitty . &) } +APPLETS=("svelte" "react" "vite") + +declare -A KNOWN_APPLETS=( + ["svelte"]="npm create svelte@latest" + ["react"]="npx create-next-app@latest" + ["vite"]="npm create vite@latest" +) + +create() { + if [[ -n "$KNOWN_APPLETS[$1]" ]]; then + eval "$KNOWN_APPLETS[$1]" + else + echo "$fg[red]FATAL:$fg[white] I don't know that applet" + echo "USAGE: create " + echo "APPLETS:" + echo " $APPLETS" + return 64 + fi +} diff --git a/zsh/git.sh b/zsh/git.sh deleted file mode 100644 index d73a554..0000000 --- a/zsh/git.sh +++ /dev/null @@ -1,27 +0,0 @@ -function git_prompt_info() { - # If we are on a folder not tracked by git, get out. - # Otherwise, check for hide-info at global and local repository level - if ! __git_prompt_git rev-parse --git-dir &> /dev/null \ - || [[ "$(__git_prompt_git config --get oh-my-zsh.hide-info 2>/dev/null)" == 1 ]]; then - return 0 - fi - - # Get either: - # - the current branch name - # - the tag name if we are on a tag - # - the short SHA of the current commit - local ref - ref=$(__git_prompt_git symbolic-ref --short HEAD 2> /dev/null) \ - || ref=$(__git_prompt_git describe --tags --exact-match HEAD 2> /dev/null) \ - || ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) \ - || return 0 - - # Use global ZSH_THEME_GIT_SHOW_UPSTREAM=1 for including upstream remote info - local upstream - if (( ${+ZSH_THEME_GIT_SHOW_UPSTREAM} )); then - upstream=$(__git_prompt_git rev-parse --abbrev-ref --symbolic-full-name "@{upstream}" 2>/dev/null) \ - && upstream=" -> ${upstream}" - fi - - echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" -} diff --git a/zsh/plugins.sh b/zsh/plugins.sh index 8d8639b..6091874 100644 --- a/zsh/plugins.sh +++ b/zsh/plugins.sh @@ -13,5 +13,4 @@ zinit light zsh-users/zsh-syntax-highlighting zinit snippet OMZP::colored-man-pages zinit snippet OMZP::sudo zinit snippet OMZP::git -zinit snippet OMZ::lib/git.zsh diff --git a/zsh/prompt.sh b/zsh/prompt.sh index efa3d24..c357c98 100644 --- a/zsh/prompt.sh +++ b/zsh/prompt.sh @@ -8,7 +8,12 @@ update_prompt() { # PROMPT+="%{$fg[yellow]%}$(git remote show | head -n 1)" # PROMPT+="%{$fg_bold[magenta] $(git_repo_name)" # PROMPT+="%{$fg_bold[blue]($(git_current_branch))%{$fg[white]%}:" - PROMPT+="%{$fg[yellow]%}$(git remote show | head -n 1) %{$fg_bold[magenta]%}$(git_repo_name)%{$fg_bold[blue]%}($(git_current_branch))%{$fg[white]%}:" + if [[ -n "$(git remote show)" ]]; then + PROMPT+="%{$fg[yellow]%}$(git remote show | head -n 1)" + else + PROMPT+="%{$fg_bold[red]%}NO-REMOTE" + fi + PROMPT+=" %{$fg_bold[magenta]%}$(git_repo_name)%{$fg_bold[blue]%}($(git_current_branch))%{$fg[white]%}:" fi