From 4e53b7c507b70cbe280153b20b132f77f58c900c Mon Sep 17 00:00:00 2001 From: afonsofrancof <me@afonsofrancof.com> Date: Fri, 16 Dec 2022 21:32:43 +0000 Subject: [PATCH] Changed some configs on nvim, tabs and some other sets --- ".config/nvim/lua/\\" | 53 +++++++++++++++++++++++++++++++++++ .config/nvim/lua/mappings.lua | 26 +++++++++-------- 2 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 ".config/nvim/lua/\\" diff --git "a/.config/nvim/lua/\\" "b/.config/nvim/lua/\\" new file mode 100644 index 0000000..135d565 --- /dev/null +++ "b/.config/nvim/lua/\\" @@ -0,0 +1,53 @@ +--Leader +vim.g.mapleader = " " +--Relative line numbers +vim.wo.number=true +vim.wo.relativenumber= true +--Remove search highlight +vim.opt.hlsearch = false +vim.opt.incsearch = true +vim.opt.smartindent = true +--Remove Wrap +vim.opt.wrap = false +--Not let cursor go bellow 10 chars. +vim.opt.scrolloff = 10 +--Undo dir +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true +--TAB KEYBINDINGS +local map = vim.api.nvim_set_keymap +local opts = { noremap = true, silent = true } + +-- Move to previous/next +map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts) +map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts) +-- Re-order to previous/next +map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts) +map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts) +-- Goto buffer in position... +map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts) +map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts) +map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts) +map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts) +map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts) +map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts) +map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts) +map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts) +map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts) +map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts) +-- Pin/unpin buffer +map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts) +-- Close buffer +map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts) +-- Magic buffer-picking mode +map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts) +-- Sort automatically by... +map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts) +map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts) +map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts) +map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts) + +--NVimTree +map('n', '<C-n>', '<Cmd>NvimTreeToggle<CR>',opts) + + diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua index 3987d4e..de53e8b 100644 --- a/.config/nvim/lua/mappings.lua +++ b/.config/nvim/lua/mappings.lua @@ -1,12 +1,24 @@ +--Leader +vim.g.mapleader = " " --Relative line numbers vim.wo.number=true vim.wo.relativenumber= true -vim.g.instant_username = "Afonso" +--Remove search highlight vim.opt.hlsearch = false +vim.opt.incsearch = true vim.opt.smartindent = true +--Remove Wrap vim.opt.wrap = false -vim.g.mapleader = " " +--Not let cursor go bellow 10 chars. vim.opt.scrolloff = 10 +--4 space indent +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true +--Undo dir +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true --TAB KEYBINDINGS local map = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } @@ -32,14 +44,6 @@ map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts) map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts) -- Close buffer map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts) --- Wipeout buffer --- :BufferWipeout --- Close commands --- :BufferCloseAllButCurrent --- :BufferCloseAllButPinned --- :BufferCloseAllButCurrentOrPinned --- :BufferCloseBuffersLeft --- :BufferCloseBuffersRight -- Magic buffer-picking mode map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts) -- Sort automatically by... @@ -48,9 +52,7 @@ map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts) map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts) map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts) - --NVimTree - map('n', '<C-n>', '<Cmd>NvimTreeToggle<CR>',opts)