diff --git a/init.lua b/init.lua index 5d4891d9..b73eca2e 100644 --- a/init.lua +++ b/init.lua @@ -7,8 +7,8 @@ require 'user.keymaps' require 'user.plugins' require 'user.colorscheme' require 'user.cmp' -require 'user.lsp' require 'user.telescope' +require 'user.lsp' require 'user.treesitter' require 'user.autopairs' require 'user.nvim-tree' diff --git a/lua/user/autocmds.lua b/lua/user/autocmds.lua new file mode 100644 index 00000000..63331da8 --- /dev/null +++ b/lua/user/autocmds.lua @@ -0,0 +1,13 @@ +-- [[ Basic Autocommands ]] +-- See `:help lua-guide-autocommands` +-- Highlight when yanking (copying) text +-- Try it with `yap` in normal mode +-- See `:help vim.highlight.on_yank()` +-- +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +}) diff --git a/lua/user/bufferline.lua b/lua/user/bufferline.lua index 7d98cf07..8082d057 100644 --- a/lua/user/bufferline.lua +++ b/lua/user/bufferline.lua @@ -33,7 +33,7 @@ bufferline.setup { -- end, max_name_length = 30, max_prefix_length = 30, -- prefix used when a buffer is de-duplicated - tab_size = 21, + tab_size = 16, diagnostics = false, -- | "nvim_lsp" | "coc", diagnostics_update_in_insert = false, -- diagnostics_indicator = function(count, level, diagnostics_dict, context) @@ -73,7 +73,7 @@ bufferline.setup { }, highlights = { fill = { - guifg = { attribute = "fg", highlight = "#ff0000" }, + guifg = { attribute = "fg", highlight = "TabLine" }, guibg = { attribute = "bg", highlight = "TabLine" }, }, background = { diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index 27e6d708..9e116cdd 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -35,12 +35,17 @@ keymap('n', '', ':vertical resize +2', opts) -- Navigate buffers keymap('n', '', ':bnext', opts) +keymap("n", "n", ":bnext", opts) keymap('n', '', ':bprevious', opts) +keymap("n", "p", ":bprev", opts) -- Insert -- --- Press jk fast to enter +-- Press fast to exit keymap('i', 'jk', '', opts) +-- Jump to beginning of line +keymap('n', 'h', '^', opts) + -- Visual -- -- Stay in indent mode keymap('v', '<', '', '>gv', opts) -- Move text up and down keymap('v', '', ':m .+1==', opts) keymap('v', '', ':m .-2==', opts) -keymap('v', 'p', '"_dP', opts) +-- paste over currently selected text without yanking it +keymap('v', 'p', '"_dp', opts) +keymap('v', 'P', '"_dP', opts) -- Visual Block -- -- Move text up and down @@ -83,7 +90,6 @@ vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' } vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) --- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { @@ -108,4 +114,19 @@ end, { desc = '[S]earch [N]eovim files' }) -- Nvimtree keymap("n", "e", ":NvimTreeToggle", opts) -keymap("n", "f", ":Format", opts) +-- keymap("n", "f", ":Format", opts) +keymap("n", "w", ":w", opts) +keymap("n", "q", ":q", opts) +keymap("n", "d", ":bdelete", opts) + +keymap("n", "", "zz", opts) +keymap("n", "", "zz", opts) + +-- Move line on the screen rather than by line in the file +vim.keymap.set("n", "j", "gj", opts) +vim.keymap.set("n", "k", "gk", opts) + +-- Select all +vim.keymap.set("n", "", "ggVG", opts) + +vim.keymap.set("n", "YY", "va{Vy", opts) diff --git a/lua/user/lsp/init.lua b/lua/user/lsp/init.lua index 0cc7120d..d183b43e 100644 --- a/lua/user/lsp/init.lua +++ b/lua/user/lsp/init.lua @@ -4,6 +4,6 @@ if not status_ok then end require "user.lsp.mason" -require("user.lsp.handlers").setup() +-- require("user.lsp.handlers").setup() require "user.lsp.null-ls" diff --git a/lua/user/lsp/mason.lua b/lua/user/lsp/mason.lua index 6bdd03d5..48e02aed 100644 --- a/lua/user/lsp/mason.lua +++ b/lua/user/lsp/mason.lua @@ -23,10 +23,10 @@ local settings = { } require("mason").setup(settings) -require("mason-lspconfig").setup({ - ensure_installed = servers, - automatic_installation = true, -}) +-- require("mason-lspconfig").setup({ +-- ensure_installed = servers, +-- automatic_installation = true, +-- }) local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig") if not lspconfig_status_ok then diff --git a/lua/user/options.lua b/lua/user/options.lua index 98db1d4c..f3ccd40a 100644 --- a/lua/user/options.lua +++ b/lua/user/options.lua @@ -5,7 +5,7 @@ local options = { completeopt = { 'menuone', 'noselect' }, -- mostly just for cmp conceallevel = 0, -- so that `` is visible in markdown files fileencoding = 'utf-8', -- the encoding written to a file - hlsearch = true, -- highlight all matches on previous search pattern + hlsearch = false, -- highlight all matches on previous search pattern ignorecase = true, -- ignore case in search patterns mouse = 'a', -- allow the mouse to be used in neovim pumheight = 10, -- pop up menu height @@ -26,7 +26,7 @@ local options = { tabstop = 2, -- insert 2 spaces for a tab cursorline = true, -- highlight the current line number = true, -- set numbered lines - relativenumber = false, -- set relative numbered lines + relativenumber = true, -- set relative numbered lines numberwidth = 4, -- set number column width to 2 {default 4} signcolumn = 'yes', -- always show the sign column, otherwise it would shift the text each time wrap = false, -- display lines as one long line diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 3309b6c9..94506c10 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -53,7 +53,6 @@ return packer.startup(function(use) use "lunarvim/darkplus.nvim" use "akinsho/bufferline.nvim" use "moll/vim-bbye" - -- cmp plugins use "hrsh7th/nvim-cmp" -- The completion plugin use "hrsh7th/cmp-buffer" -- buffer completions diff --git a/tester.py b/tester.py new file mode 100644 index 00000000..e392f2f4 --- /dev/null +++ b/tester.py @@ -0,0 +1,5 @@ +x = [1, 2, 3] + +for item in x: + print(item) +# print(type(mydict))