From cc32601238029a06bf9a9817514dfbfb3d48b126 Mon Sep 17 00:00:00 2001 From: Marc Pervaz Boocha Date: Tue, 4 Feb 2025 00:30:21 +0530 Subject: Update neovim and added static http-server --- .config/nvim/init.lua | 4 +- .local/bin/http-static | 31 ++++++++++++++ .local/share/nvim/site/pack/plugins/start/conform | 2 +- .local/share/nvim/site/pack/plugins/start/lazydev | 2 +- .../nvim/site/pack/plugins/start/mason-lspconfig | 2 +- .local/share/nvim/site/pack/plugins/start/nvim-cmp | 2 +- .../nvim/site/pack/plugins/start/nvim-lspconfig | 2 +- .../nvim/site/pack/plugins/start/nvim-treesitter | 2 +- .profile | 47 ++++++++++------------ .zfunc/zsh-completions | 2 +- .zshrc | 4 +- 11 files changed, 65 insertions(+), 35 deletions(-) create mode 100755 .local/bin/http-static diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b28863e..b2f3021 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -41,6 +41,8 @@ vim.opt.fillchars = { vim.o.showtabline = 2 +vim.cmd.colorscheme('retrobox') + vim.keymap.set({ 'n', 'x' }, 'y', '"+y') vim.keymap.set('n', 'p', '"+p') vim.keymap.set('x', 'p', '"+P') @@ -53,7 +55,7 @@ vim.keymap.set('n', '', function() end) vim.keymap.set('n', 't', function() - vim.cmd.vsplit() + vim.cmd.split() vim.cmd.terminal() end) diff --git a/.local/bin/http-static b/.local/bin/http-static new file mode 100755 index 0000000..7e6fa55 --- /dev/null +++ b/.local/bin/http-static @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +from argparse import ArgumentParser +from collections.abc import Sequence +from typing import Optional +from pathlib import Path +from http.server import SimpleHTTPRequestHandler,ThreadingHTTPServer +import sys + +def serve(bind, port, directory): + def handler(request, client_address, server): + return SimpleHTTPRequestHandler(request, client_address, server, directory=directory) + + with ThreadingHTTPServer((bind, port), handler) as httpd: + print(*httpd.socket.getsockname()) + try: + httpd.serve_forever() + except KeyboardInterrupt: + return + + +def main(argv: Optional[Sequence[str]] = None): + parser = ArgumentParser() + parser.add_argument('-b', '--bind', metavar='ADDRESS', default='', help='bind to this address') + parser.add_argument('-p', '--port', default=8080, type=int, help='bind to this port') + parser.add_argument('directory', type=Path, default=Path.cwd(), nargs="?", help='serve this directory') + args = parser.parse_args(argv) + serve(**vars(args)) + +if __name__ == '__main__': + sys.exit(main()) diff --git a/.local/share/nvim/site/pack/plugins/start/conform b/.local/share/nvim/site/pack/plugins/start/conform index 7001912..363243c 160000 --- a/.local/share/nvim/site/pack/plugins/start/conform +++ b/.local/share/nvim/site/pack/plugins/start/conform @@ -1 +1 @@ -Subproject commit 70019124aa4f2e6838be9fbd2007f6d13b27a96d +Subproject commit 363243c03102a531a8203311d4f2ae704c620d9b diff --git a/.local/share/nvim/site/pack/plugins/start/lazydev b/.local/share/nvim/site/pack/plugins/start/lazydev index 8620f82..a1b78b2 160000 --- a/.local/share/nvim/site/pack/plugins/start/lazydev +++ b/.local/share/nvim/site/pack/plugins/start/lazydev @@ -1 +1 @@ -Subproject commit 8620f82ee3f59ff2187647167b6b47387a13a018 +Subproject commit a1b78b2ac6f978c72e76ea90ae92a94edf380cfc diff --git a/.local/share/nvim/site/pack/plugins/start/mason-lspconfig b/.local/share/nvim/site/pack/plugins/start/mason-lspconfig index 97d9f1d..f75e877 160000 --- a/.local/share/nvim/site/pack/plugins/start/mason-lspconfig +++ b/.local/share/nvim/site/pack/plugins/start/mason-lspconfig @@ -1 +1 @@ -Subproject commit 97d9f1d3ad205dece6bcafd1d71cf1507608f3c7 +Subproject commit f75e877f5266e87523eb5a18fcde2081820d087b diff --git a/.local/share/nvim/site/pack/plugins/start/nvim-cmp b/.local/share/nvim/site/pack/plugins/start/nvim-cmp index 8c82d0b..1250990 160000 --- a/.local/share/nvim/site/pack/plugins/start/nvim-cmp +++ b/.local/share/nvim/site/pack/plugins/start/nvim-cmp @@ -1 +1 @@ -Subproject commit 8c82d0bd31299dbff7f8e780f5e06d2283de9678 +Subproject commit 12509903a5723a876abd65953109f926f4634c30 diff --git a/.local/share/nvim/site/pack/plugins/start/nvim-lspconfig b/.local/share/nvim/site/pack/plugins/start/nvim-lspconfig index 8815752..00b236b 160000 --- a/.local/share/nvim/site/pack/plugins/start/nvim-lspconfig +++ b/.local/share/nvim/site/pack/plugins/start/nvim-lspconfig @@ -1 +1 @@ -Subproject commit 88157521e890fe7fdf18bee22438875edd6300a6 +Subproject commit 00b236b795acfb79339bd6771488c155073a2889 diff --git a/.local/share/nvim/site/pack/plugins/start/nvim-treesitter b/.local/share/nvim/site/pack/plugins/start/nvim-treesitter index 097fb77..4e70177 160000 --- a/.local/share/nvim/site/pack/plugins/start/nvim-treesitter +++ b/.local/share/nvim/site/pack/plugins/start/nvim-treesitter @@ -1 +1 @@ -Subproject commit 097fb77312c731347180e8907424f6c967323f05 +Subproject commit 4e701776f8824fc188a6254f57d080971ce28c92 diff --git a/.profile b/.profile index 193625a..786cf6a 100644 --- a/.profile +++ b/.profile @@ -18,38 +18,35 @@ do done export PATH - export XDG_CONFIG_HOME="$HOME/.config/" export XDG_CACHE_HOME="$HOME/.cache/" export XDG_DATA_HOME="$HOME/.local/share" export XDG_STATE_HOME="$HOME/.local/state/" -if command -v nvim > /dev/null -then - export VISUAL=nvim -elif command -v vim > /dev/null -then - export VISUAL=vim -elif command -v vi > /dev/null -then - export VISUAL=vi -fi +for i in nvim vim vi +do + if command -v "$i" > /dev/null + then + export VISUAL="$i" + break + fi +done -if command -v ex > /dev/null -then - export EDITOR=nvim -elif command -v ed > /dev/null -then - export EDITOR=vim -fi +for i in ex ed +do + if command -v "$i" > /dev/null + then + export EDITOR=$i + fi +done -if command -v less > /dev/null -then - export PAGER=less -elif command -v more > /dev/null -then - export PAGER=more -fi +for i in less more +do + if command -v "$i" > /dev/null + then + export PAGER=less + fi +done if test -f "$HOME"/.cargo/env then diff --git a/.zfunc/zsh-completions b/.zfunc/zsh-completions index a7f0162..85e041b 160000 --- a/.zfunc/zsh-completions +++ b/.zfunc/zsh-completions @@ -1 +1 @@ -Subproject commit a7f01622f7bc6941d1c6297be6995fe1bbc9d4de +Subproject commit 85e041be36a33d8f6ca71746654406425d3a910f diff --git a/.zshrc b/.zshrc index bd268c0..e568f25 100644 --- a/.zshrc +++ b/.zshrc @@ -7,12 +7,12 @@ autoload -Uz edit-command-line zle -N edit-command-line bindkey -M vicmd v edit-command-line -HISTFILE=$HOME/.histfile +HISTFILE="$HOME/.histfile" HISTSIZE=1000 SAVEHIST=1000 setopt hist_ignore_all_dups hist_save_no_dups hist_reduce_blanks share_history extended_history -fpath=($HOME/.zfunc $HOME/.zfunc/zsh-completions/src $fpath) +fpath=("$HOME/.zfunc" "$HOME/.zfunc/zsh-completions/src" $fpath) alias diff='diff --color=auto' alias ls='ls -F --color=auto' -- cgit v1.2.3-70-g09d2