From ba9923feac6f86c7a4a6b6471a811aef33db1b99 Mon Sep 17 00:00:00 2001 From: cubernetes Date: Sun, 13 Aug 2023 23:21:29 +0200 Subject: [PATCH] nvim remaps --- .bashrc | 4 ++-- .config/nvim/after/plugin/lsp.lua | 8 ++++---- .config/nvim/lua/tosu/packer.lua | 1 + .config/nvim/lua/tosu/remap.lua | 9 ++++++++- .config/nvim/plugin/packer_compiled.lua | 5 +++++ 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.bashrc b/.bashrc index b081919..49a4030 100644 --- a/.bashrc +++ b/.bashrc @@ -157,7 +157,7 @@ function paruuu () { && yes | paru -Syu --devel --noconfirm \ && printf "\033[30;41m%s\033[m\n" "pacman -Qtdq | pacman -Rns -" \ && { pacman -Qtdq | 2>/dev/null sudo pacman --noconfirm -Rns - \ - || printf "\033[30;42m%s\033[m\n" "No orphan packages!"; } \ + || printf "\033[30;42m%s\033[m\n" "No pacman orphan packages :)!"; } \ && printf "\033[30;42m%s\033[m\n" "###### Done without error ######" \ || printf "\033[30;41m%s\033[m\n" "###### Some error occured! ######" ) @@ -374,7 +374,7 @@ if [ -f "${HOME}"/.userbashrc ]; then . "${HOME}"/.userbashrc; fi alias new_mp_project='clear && builtin cd -P ./ && python3 -m venv ./env/ && . ./env/bin/activate && pip install --no-input opencv-python mediapipe && pip freeze > ./requirements.txt && printf '\''#!/usr/bin/env python3\n\nfrom typing import NoReturn\n\nimport mediapipe as mp\nimport cv2\n\n\ndef main() -> NoReturn:\n\tpass\n\nif __name__ == '\''"'\''"'\''__main__'\''"'\''"'\'':\n\tmain()\n'\'' 1>./main.py && chmod +x ./main.py && printf '\''__pycache__/\nenv/\n'\'' 1>.gitignore && git init && git add -A && git commit -m '\''Initial commit'\'' && git ls-files && echo Done' alias check_for_tabs="clear && 2>/dev/null grep -r ' ' ../ | grep -v pre-rebase | grep -v sendemail | grep -v update.sample | grep -v fsmonitor | grep -v pre-push | grep -v commit-msg | grep -v pre-commit | grep -v push-to- | grep -v pre-receive | grep -v ChangeLog | grep -v '.git/config' | grep -v autogen | grep -v configure.ac | grep -v Makefile | grep -v debian | grep -v lxpolkit-listener | grep -v '.git' | grep -v desktop-files | grep -v autostart.vala | grep -v combobox | grep -v main.vala | grep -v vala | grep -v lxsession-default | grep -v logout | grep -v settings-daemon | grep -v xdg-autostart | grep -v data/images | grep -v compile.sh | grep -v lxsession.xml | grep -v lxsession-utils" # alias lxsession-edit='cd /tmp/lxsession/lxsession-edit && ./compile.sh && 2>/dev/null ./lxsession-edit' -function c () { +function x () { cc -std=c89 -Wall -Wextra -pedantic -Werror -Wconversion -g -O0 -o main *.c && ./main "${@}" rm -f ./main } diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 5042925..074341f 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -79,7 +79,7 @@ null_ls.setup({ } }) --- require("norme").setup({ --- -- Your configuration --- cmd = os.getenv('HOME') .. '/.local/bin/norminette' --- }) +require("norme").setup({ + -- Your configuration + cmd = os.getenv('HOME') .. '/.local/bin/norminette' +}) diff --git a/.config/nvim/lua/tosu/packer.lua b/.config/nvim/lua/tosu/packer.lua index f2b64be..66bad8c 100644 --- a/.config/nvim/lua/tosu/packer.lua +++ b/.config/nvim/lua/tosu/packer.lua @@ -25,6 +25,7 @@ return require('packer').startup(function(use) use('vim-airline/vim-airline') use('vim-airline/vim-airline-themes') use('cacharle/c_formatter_42.vim') + use('m4xshen/autoclose.nvim') use({ 'VonHeikemen/lsp-zero.nvim', branch = 'v2.x', diff --git a/.config/nvim/lua/tosu/remap.lua b/.config/nvim/lua/tosu/remap.lua index 4ca543d..2c597cc 100644 --- a/.config/nvim/lua/tosu/remap.lua +++ b/.config/nvim/lua/tosu/remap.lua @@ -25,7 +25,7 @@ vim.keymap.set("n", "f", function() vim.lsp.buf.format() end) --- vims quickfix feature, no idea how it works +-- vims quickfix feature, don't need it atm -- vim.keymap.set("n", "", "cnextzz") -- vim.keymap.set("n", "", "cprevzz") -- vim.keymap.set("n", "k", "lnextzz") @@ -33,3 +33,10 @@ end) vim.keymap.set("n", "s", ":%s/\\<\\>//gI") vim.keymap.set("n", "x", "!chmod +x %") + +vim.keymap.set("n", "x", ":w:!cc -std=c89 -Wall -Wextra -pedantic -Werror -Wconversion -g -O0 -o main *.c && ./main ; rm -f ./main") + +vim.keymap.set("n", "c", "mz:s/\\(^\\s*\\)\\(.*$\\)/\\1\\/* \\2 *\\//g:noh`z") +vim.keymap.set("n", "C", "mz:s/\\/\\* \\(.*\\) \\*\\//\\1/g:noh`z") +vim.keymap.set("v", "c", "mz:s/\\(^\\s*\\)\\(.*$\\)/\\1\\/* \\2 *\\//g:noh`z") +vim.keymap.set("v", "C", "mz:s/\\/\\* \\(.*\\) \\*\\//\\1/g:noh`z") diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua index 2298544..ae7a16b 100644 --- a/.config/nvim/plugin/packer_compiled.lua +++ b/.config/nvim/plugin/packer_compiled.lua @@ -79,6 +79,11 @@ _G.packer_plugins = { path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/LuaSnip", url = "https://github.com/L3MON4D3/LuaSnip" }, + ["autoclose.nvim"] = { + loaded = true, + path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/autoclose.nvim", + url = "https://github.com/m4xshen/autoclose.nvim" + }, ["c_formatter_42.vim"] = { loaded = true, path = "/home/tosuman/.local/share/nvim/site/pack/packer/start/c_formatter_42.vim",