From ad15079ec7395359704c61e41b47d8b406480147 Mon Sep 17 00:00:00 2001 From: TiagoRG Date: Sun, 3 Mar 2024 00:00:41 +0000 Subject: [PATCH] Vim changes Signed-off-by: TiagoRG --- .config/nvim/after/plugin/lsp.lua | 3 +++ .config/nvim/after/plugin/lualine.lua | 3 ++- .config/nvim/after/plugin/tabset.lua | 2 +- .config/nvim/after/plugin/treesitter.lua | 2 +- .config/nvim/data/colorscheme.txt | 2 +- .config/nvim/lua/tiagorg/packer.lua | 3 +-- .config/nvim/lua/tiagorg/remap.lua | 15 +++++++++---- .config/nvim/lua/tiagorg/set.lua | 17 +++++++++----- .config/nvim/plugin/packer_compiled.lua | 10 ++++----- .config/nvim/snippets/asm.snippets | 28 ++++++++++++++++++++++++ .gitignore | 1 + .vimrc | 20 ++++++++++++----- 12 files changed, 80 insertions(+), 26 deletions(-) create mode 100644 .config/nvim/snippets/asm.snippets diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 6eb3388..1cc7e9a 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -1,5 +1,8 @@ local lsp = require("lsp-zero") +vim.opt.pumheight = 10 +vim.opt.pumwidth = 30 + lsp.preset("recommended") -- Fix Undefined global 'vim' diff --git a/.config/nvim/after/plugin/lualine.lua b/.config/nvim/after/plugin/lualine.lua index 526e0ea..7b0315e 100644 --- a/.config/nvim/after/plugin/lualine.lua +++ b/.config/nvim/after/plugin/lualine.lua @@ -18,7 +18,8 @@ require('lualine').setup { } }, sections = { - lualine_a = { 'fileformat', 'mode' }, + -- lualine_a = { 'fileformat', 'mode' }, + lualine_a = { 'mode' }, lualine_b = { 'branch', 'diff', 'diagnostics' }, lualine_c = { 'filename', 'aerial' }, lualine_x = { 'filesize', 'filetype' }, diff --git a/.config/nvim/after/plugin/tabset.lua b/.config/nvim/after/plugin/tabset.lua index c4b4254..03e0c87 100644 --- a/.config/nvim/after/plugin/tabset.lua +++ b/.config/nvim/after/plugin/tabset.lua @@ -18,7 +18,7 @@ require("tabset").setup({ } }, { - filetypes = { "Makefile", "make" }, + filetypes = { "Makefile", "make", "snippets" }, config = { tabwidth = 4, expandtab = false diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua index 20062f9..77fd0e6 100644 --- a/.config/nvim/after/plugin/treesitter.lua +++ b/.config/nvim/after/plugin/treesitter.lua @@ -25,7 +25,7 @@ require 'nvim-treesitter.configs'.setup { rainbow = { enable = true, -- list of languages you want to disable the plugin for - disable = { 'jsx', 'cpp' }, + disable = { 'jsx' }, -- Which query to use for finding delimiters query = 'rainbow-parens', -- Highlight the entire buffer all at once diff --git a/.config/nvim/data/colorscheme.txt b/.config/nvim/data/colorscheme.txt index 0d83d6f..75be144 100644 --- a/.config/nvim/data/colorscheme.txt +++ b/.config/nvim/data/colorscheme.txt @@ -1 +1 @@ -rose-pine \ No newline at end of file +monokai-pro \ No newline at end of file diff --git a/.config/nvim/lua/tiagorg/packer.lua b/.config/nvim/lua/tiagorg/packer.lua index 6d88b4a..05ed569 100644 --- a/.config/nvim/lua/tiagorg/packer.lua +++ b/.config/nvim/lua/tiagorg/packer.lua @@ -13,6 +13,7 @@ return require('packer').startup(function(use) } use 'olimorris/onedarkpro.nvim' use 'Mofiqul/vscode.nvim' + use 'Mofiqul/dracula.nvim' -- Essentials use { @@ -66,7 +67,6 @@ return require('packer').startup(function(use) use('wakatime/vim-wakatime') use('andweeb/presence.nvim') - -- Little friend use("github/copilot.vim") @@ -80,7 +80,6 @@ return require('packer').startup(function(use) "nvim-telescope/telescope.nvim" } } - use "Pocco81/AutoSave.nvim" use 'TiagoRG/liveshare.nvim' end) diff --git a/.config/nvim/lua/tiagorg/remap.lua b/.config/nvim/lua/tiagorg/remap.lua index 0aca12b..f41a5c3 100644 --- a/.config/nvim/lua/tiagorg/remap.lua +++ b/.config/nvim/lua/tiagorg/remap.lua @@ -1,10 +1,17 @@ --vim.keymap.set("n", "e", vim.cmd.E) vim.keymap.set("n", "w", vim.cmd.w) vim.keymap.set({ "n", "i" }, "", vim.cmd.w) +vim.keymap.set("n", "o", "o") +vim.keymap.set("n", "O", "O") vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") +vim.keymap.set("n", "", "h") +vim.keymap.set("n", "", "j") +vim.keymap.set("n", "", "k") +vim.keymap.set("n", "", "l") + vim.keymap.set("v", "", ">gv") vim.keymap.set("v", "", "f", vim.lsp.buf.format) vim.keymap.set("n", "af", "ggVG") vim.keymap.set("n", "ab", "GVgg") -vim.keymap.set("n", "", "cnextzz") -vim.keymap.set("n", "", "cprevzz") -vim.keymap.set("n", "k", "lnextzz") -vim.keymap.set("n", "j", "lprevzz") +-- vim.keymap.set("n", "", "cnextzz") +-- vim.keymap.set("n", "", "cprevzz") +-- vim.keymap.set("n", "k", "lnextzz") +-- vim.keymap.set("n", "j", "lprevzz") vim.keymap.set("v", "rs", [[:s/\<\>//gI]]) vim.keymap.set("n", "ra", [[:%s/\<\>//gI]]) diff --git a/.config/nvim/lua/tiagorg/set.lua b/.config/nvim/lua/tiagorg/set.lua index c22193d..c413080 100644 --- a/.config/nvim/lua/tiagorg/set.lua +++ b/.config/nvim/lua/tiagorg/set.lua @@ -4,17 +4,23 @@ vim.g.mouse = "a" vim.opt.updatetime = 50 vim.opt.wrap = false -vim.opt.nu = true +vim.opt.number = true vim.opt.relativenumber = true -vim.opt.scrolloff = 10 vim.opt.signcolumn = "yes" +vim.opt.scrolloff = 10 vim.opt.colorcolumn = "0" +vim.opt.cursorline = true + +vim.opt.hlsearch = true +vim.opt.incsearch = true +vim.opt.ignorecase = true +vim.opt.scs = true vim.opt.smartindent = true +vim.opt.autoindent = true -vim.opt.hls = true -vim.opt.is = true -vim.opt.ic = true +vim.opt.showmode = false +vim.opt.wildmenu = true vim.opt.swapfile = false vim.opt.backup = false @@ -25,6 +31,5 @@ vim.opt.termguicolors = true vim.opt.isfname:append("@-@") vim.opt.guitablabel = "\\[%N\\]\\ %t\\ %M" - vim.g.copilot_node_command = "/usr/bin/nodenv" vim.g.copilot_assume_mapped = true diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua index f70a063..ce2fe9e 100644 --- a/.config/nvim/plugin/packer_compiled.lua +++ b/.config/nvim/plugin/packer_compiled.lua @@ -74,11 +74,6 @@ end time([[try_loadstring definition]], false) time([[Defining packer_plugins]], true) _G.packer_plugins = { - ["AutoSave.nvim"] = { - loaded = true, - path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/AutoSave.nvim", - url = "https://github.com/Pocco81/AutoSave.nvim" - }, ["ChatGPT.nvim"] = { loaded = true, path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/ChatGPT.nvim", @@ -139,6 +134,11 @@ _G.packer_plugins = { path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/copilot.vim", url = "https://github.com/github/copilot.vim" }, + ["dracula.nvim"] = { + loaded = true, + path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/dracula.nvim", + url = "https://github.com/Mofiqul/dracula.nvim" + }, ["friendly-snippets"] = { loaded = true, path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/friendly-snippets", diff --git a/.config/nvim/snippets/asm.snippets b/.config/nvim/snippets/asm.snippets new file mode 100644 index 0000000..71b0447 --- /dev/null +++ b/.config/nvim/snippets/asm.snippets @@ -0,0 +1,28 @@ +snippet detports + .equ ADDR_BASE, 0xBF88 + .equ TRISB, 0x6040 + .equ PORTB, 0x6050 + .equ LATB, 0x6060 + .equ TRISC, 0x6080 + .equ PORTC, 0x6090 + .equ LATC, 0x60A0 + .equ TRISD, 0x60C0 + .equ PORTD, 0x60D0 + .equ LATD, 0x60E0 + .equ TRISE, 0x6100 + .equ PORTE, 0x6110 + .equ LATE, 0x6120 + +snippet detsyscalls + .equ INKEY, 1 + .equ GETCHAR, 2 + .equ PUTCHAR, 3 + .equ READ_INT, 4 + .equ READ_INT10, 5 + .equ PRINT_INT, 6 + .equ PRINT_INT10, 7 + .equ PRINT_STR, 8 + .equ READ_STR, 9 + .equ EXIT, 10 + .equ READ_CORE_TIMER, 11 + .equ RESET_CORE_TIMER, 12 diff --git a/.gitignore b/.gitignore index f1d7a3f..eb4eaa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ # Vim stuff .vim/.netrwhist .vim/undodir/ +.vim/pack/ diff --git a/.vimrc b/.vimrc index affccc2..b4593b5 100644 --- a/.vimrc +++ b/.vimrc @@ -1,18 +1,21 @@ -set nu +set number set relativenumber -set signcolumn=yes +set signcolumn=auto set colorcolumn=0 +set cursorline set smartindent set tabstop=4 set shiftwidth=4 set ls=2 -set hls -set is -set ic +set hlsearch +set incsearch +set ignorecase set scrolloff=10 +set wildmenu + let g:mapleader=" " syntax on @@ -20,6 +23,13 @@ colorscheme onedark nnoremap w :w nnoremap e :E +nnoremap o o +nnoremap O O + +nnoremap h +nnoremap j +nnoremap k +nnoremap l xnoremap J :move '>+1gv=gv xnoremap K :move '<-2gv=gv