From c38462c0d28931daef5790d6b94699025d77214c Mon Sep 17 00:00:00 2001 From: Andy Teijelo Date: Fri, 14 Oct 2022 17:19:21 -0400 Subject: [PATCH] my changes --- lua/user/colorscheme.lua | 7 ++++++- lua/user/indentline.lua | 29 +++++++++++++++-------------- lua/user/keymaps.lua | 14 +++++++++++--- lua/user/lsp/mason.lua | 1 + lua/user/options.lua | 8 ++++---- lua/user/plugins.lua | 18 +++++++++++++++++- 6 files changed, 54 insertions(+), 23 deletions(-) diff --git a/lua/user/colorscheme.lua b/lua/user/colorscheme.lua index 881eba5..9eacc2c 100644 --- a/lua/user/colorscheme.lua +++ b/lua/user/colorscheme.lua @@ -1,4 +1,9 @@ -local colorscheme = "tokyonight-night" +--require("catppuccin").setup() +--vim.cmd [[colorscheme catppuccin]] + +--local colorscheme = "tokyonight-night" +vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha +local colorscheme = "catppuccin" local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) if not status_ok then diff --git a/lua/user/indentline.lua b/lua/user/indentline.lua index b7389d9..dc53b6a 100644 --- a/lua/user/indentline.lua +++ b/lua/user/indentline.lua @@ -1,18 +1,19 @@ +local enabled = false local status_ok, indent_blankline = pcall(require, "indent_blankline") -if not status_ok then +if (not enabled) or (not status_ok) then return end -indent_blankline.setup { - char = "▏", - show_trailing_blankline_indent = false, - show_first_indent_level = true, - use_treesitter = true, - show_current_context = true, - buftype_exclude = { "terminal", "nofile" }, - filetype_exclude = { - "help", - "packer", - "NvimTree", - }, -} +--indent_blankline.setup { +-- char = "▏", +-- show_trailing_blankline_indent = false, +-- show_first_indent_level = true, +-- use_treesitter = true, +-- show_current_context = true, +-- buftype_exclude = { "terminal", "nofile" }, +-- filetype_exclude = { +-- "help", +-- "packer", +-- "NvimTree", +-- }, +--} diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index 7b9bddb..ba8e8d8 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -31,19 +31,27 @@ keymap("n", "", ":vertical resize +2", opts) -- Navigate buffers keymap("n", "", ":bnext", opts) keymap("n", "", ":bprevious", opts) +for _, mode in ipairs({"n", "i", "v"}) do + vim.keymap.set(mode, '', "BufferLineGoToBuffer 1", { noremap = true, silent = true }) + vim.keymap.set(mode, '', "BufferLineGoToBuffer 2", { noremap = true, silent = true }) + vim.keymap.set(mode, '', "BufferLineGoToBuffer 3", { noremap = true, silent = true }) + vim.keymap.set(mode, '', "BufferLineGoToBuffer 4", { noremap = true, silent = true }) + vim.keymap.set(mode, '', "BufferLineGoToBuffer 5", { noremap = true, silent = true }) +end + -- Clear highlights keymap("n", "h", "nohlsearch", opts) -- Close buffers -keymap("n", "", "Bdelete!", opts) +keymap("n", "", "Bdelete", opts) -- Better paste keymap("v", "p", '"_dP', opts) -- Insert -- -- Press jk fast to enter -keymap("i", "jk", "", opts) +--keymap("i", "jk", "", opts) -- Visual -- -- Stay in indent mode @@ -62,7 +70,7 @@ keymap("n", "fp", ":Telescope projects", opts) keymap("n", "fb", ":Telescope buffers", opts) -- Git -keymap("n", "gg", "lua _LAZYGIT_TOGGLE()", opts) +--keymap("n", "gg", "lua _LAZYGIT_TOGGLE()", opts) -- Comment keymap("n", "/", "lua require('Comment.api').toggle_current_linewise()", opts) diff --git a/lua/user/lsp/mason.lua b/lua/user/lsp/mason.lua index af3a665..d1f281c 100644 --- a/lua/user/lsp/mason.lua +++ b/lua/user/lsp/mason.lua @@ -7,6 +7,7 @@ local servers = { "bashls", "jsonls", "yamlls", + "rust_analyzer", } local settings = { diff --git a/lua/user/options.lua b/lua/user/options.lua index 3c45705..24ced53 100644 --- a/lua/user/options.lua +++ b/lua/user/options.lua @@ -21,14 +21,14 @@ vim.opt.undofile = true -- enable persistent undo vim.opt.updatetime = 300 -- faster completion (4000ms default) vim.opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited vim.opt.expandtab = true -- convert tabs to spaces -vim.opt.shiftwidth = 2 -- the number of spaces inserted for each indentation -vim.opt.tabstop = 2 -- insert 2 spaces for a tab +vim.opt.shiftwidth = 4 -- the number of spaces inserted for each indentation +vim.opt.tabstop = 4 -- insert 2 spaces for a tab vim.opt.cursorline = true -- highlight the current line vim.opt.number = true -- set numbered lines vim.opt.laststatus = 3 -- only the last window will always have a status line -vim.opt.showcmd = false -- hide (partial) command in the last line of the screen (for performance) +vim.opt.showcmd = true -- hide (partial) command in the last line of the screen (for performance) vim.opt.ruler = false -- hide the line and column number of the cursor position -vim.opt.numberwidth = 4 -- minimal number of columns to use for the line number {default 4} +--vim.opt.numberwidth = 4 -- minimal number of columns to use for the line number {default 4} vim.opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time vim.opt.wrap = false -- display lines as one long line vim.opt.scrolloff = 8 -- minimal number of screen lines to keep above and below the cursor diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 00389db..e5151d3 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -57,12 +57,13 @@ return packer.startup(function(use) use { "akinsho/toggleterm.nvim", commit = "2a787c426ef00cb3488c11b14f5dcf892bbd0bda" } use { "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6" } use { "lewis6991/impatient.nvim", commit = "b842e16ecc1a700f62adb9802f8355b99b52a5a6" } - use { "lukas-reineke/indent-blankline.nvim", commit = "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" } + --use { "lukas-reineke/indent-blankline.nvim", commit = "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" } use { "goolord/alpha-nvim", commit = "0bb6fc0646bcd1cdb4639737a1cee8d6e08bcc31" } -- Colorschemes use { "folke/tokyonight.nvim", commit = "66bfc2e8f754869c7b651f3f47a2ee56ae557764" } use { "lunarvim/darkplus.nvim", commit = "13ef9daad28d3cf6c5e793acfc16ddbf456e1c83" } + use { "catppuccin/nvim", as = "catppuccin" } -- cmp plugins use { "hrsh7th/nvim-cmp", commit = "b0dff0ec4f2748626aae13f011d1a47071fe9abc" } -- The completion plugin @@ -101,6 +102,21 @@ return packer.startup(function(use) use { "rcarriga/nvim-dap-ui", commit = "d76d6594374fb54abf2d94d6a320f3fd6e9bb2f7" } use { "ravenxrz/DAPInstall.nvim", commit = "8798b4c36d33723e7bba6ed6e2c202f84bb300de" } + use { + "klen/nvim-config-local", + config = function() + require('config-local').setup { + -- Default configuration (optional) + config_files = { ".nvimrc.lua" }, -- Config file patterns to load (lua supported) + hashfile = vim.fn.stdpath("data") .. "/config-local", -- Where the plugin keeps files data + autocommands_create = false, -- Create autocommands (VimEnter, DirectoryChanged) + commands_create = false, -- Create commands (ConfigSource, ConfigEdit, ConfigTrust, ConfigIgnore) + silent = true, -- Disable plugin messages (Config loaded/ignored) + lookup_parents = false, -- Lookup config files in parent directories + } + end + } + -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if PACKER_BOOTSTRAP then