From bf7bdf0060a63c4a6472f5249af2b9354da171e8 Mon Sep 17 00:00:00 2001 From: pika Date: Fri, 5 Jul 2024 22:41:44 +0200 Subject: [PATCH] some changes --- lua/pika/core/keymaps.lua | 3 + lua/pika/core/options.lua | 28 +++++----- lua/pika/plugins/bufferline.lua | 28 +++++++--- lua/pika/plugins/colorscheme.lua | 72 ++++++++---------------- lua/pika/plugins/lsp/mason.lua | 94 ++++++++++++++++---------------- lua/pika/plugins/substitute.lua | 17 ------ 6 files changed, 108 insertions(+), 134 deletions(-) delete mode 100644 lua/pika/plugins/substitute.lua diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index fe6951e..8f94dff 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -85,6 +85,9 @@ map("v", "cC", "CBclbox14", { noremap = true, silent = true, de map("n", "cl", "CBllline8", { noremap = true, silent = true, desc = "[c]reate comment [l]ine" }) map("n", "cL", "CBlcline8", { noremap = true, silent = true, desc = "[c]reate comment [L]ine" }) +-- ─< rename word under cursor >─────────────────────────────────────────────────────────── +map("n", "R", [[:%s/\<\>//gI]]) + -- ─< LoremIpsum generator >──────────────────────────────────────────────────────────── map("n", "L", ":LoremIpsum ") diff --git a/lua/pika/core/options.lua b/lua/pika/core/options.lua index d37ac12..656109f 100644 --- a/lua/pika/core/options.lua +++ b/lua/pika/core/options.lua @@ -1,4 +1,4 @@ -vim.cmd 'let g:netrw_liststyle = 3' +vim.cmd("let g:netrw_liststyle = 3") local o = vim.opt @@ -15,7 +15,7 @@ o.softtabstop = 2 o.expandtab = true -- expand tab to spaces o.autoindent = true -- copy indent from current line when starting new one -o.mouse = 'a' +o.mouse = "a" o.wrap = false -- search settings @@ -30,14 +30,14 @@ o.showmode = false -- turn on termguicolors for tokyonight colorscheme to work -- (have to use iterm2 or any other true color terminal) o.termguicolors = true -o.background = 'dark' -- colorschemes that can be light or dark will be made dark -o.signcolumn = 'yes' -- show sign column so that text doesn't shift +o.background = "dark" -- colorschemes that can be light or dark will be made dark +o.signcolumn = "yes" -- show sign column so that text doesn't shift -- backspace -o.backspace = 'indent,eol,start' -- allow backspace on indent, end of line or insert mode start position +o.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position -- clipboard -o.clipboard:append 'unnamedplus' -- use system clipboard as default register +o.clipboard:append("unnamedplus") -- use system clipboard as default register -- split windows o.splitright = true -- split vertical window to the right @@ -46,19 +46,19 @@ o.splitbelow = true -- split horizontal window to the bottom -- turn off swapfile o.swapfile = false -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, +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, }) -- Set cursor to beam when entering Neovim -vim.cmd [[ +vim.cmd([[ augroup ChangeCursorShape autocmd! autocmd VimEnter * set guicursor=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20 autocmd VimLeave * set guicursor=a:ver25 augroup END -]] +]]) diff --git a/lua/pika/plugins/bufferline.lua b/lua/pika/plugins/bufferline.lua index 7e1a826..8367fac 100644 --- a/lua/pika/plugins/bufferline.lua +++ b/lua/pika/plugins/bufferline.lua @@ -1,10 +1,22 @@ return { - "akinsho/bufferline.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - version = "*", - opts = { - options = { - mode = "tabs", - }, - }, + "akinsho/bufferline.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + version = "*", + opts = { + options = { + show_buffer_icons = true, + diagnostics = "nvim_lsp", + offsets = { { filetype = "neo-tree", text = "File Explorer", highlight = "Directory" } }, + buffers = { + -- You can set buffer_mode to "list" or "tabbed" based on your preference. + buffer_mode = "list", + }, + }, + }, + config = function(_, opts) + require("bufferline").setup(opts) + -- Remap the tab key for buffer navigation (you can adjust the keys as needed) + vim.keymap.set("n", "", "BufferLineCycleNext") + vim.keymap.set("n", "", "BufferLineCyclePrev") + end, } diff --git a/lua/pika/plugins/colorscheme.lua b/lua/pika/plugins/colorscheme.lua index 229719f..9fb5a7f 100644 --- a/lua/pika/plugins/colorscheme.lua +++ b/lua/pika/plugins/colorscheme.lua @@ -1,50 +1,26 @@ return { - 'ribru17/bamboo.nvim', - lazy = false, - priority = 1000, -- Make sure to load this before all the other start plugins. - config = function() - require('bamboo').setup { - -- optional configuration here - } - require('bamboo').load() - end, - -- - -- local bg = "#011628" - -- local bg_dark = "#011423" - -- local bg_highlight = "#143652" - -- local bg_search = "#0A64AC" - -- local bg_visual = "#275378" - -- local fg = "#CBE0F0" - -- local fg_dark = "#B4D0E9" - -- local fg_gutter = "#627E97" - -- local border = "#547998" - -- - -- require("tokyonight").setup({ - -- style = "night", - -- transparent = transparent, - -- styles = { - -- sidebars = transparent and "transparent" or "dark", - -- floats = transparent and "transparent" or "dark", - -- }, - -- on_colors = function(colors) - -- colors.bg = bg - -- colors.bg_dark = transparent and colors.none or bg_dark - -- colors.bg_float = transparent and colors.none or bg_dark - -- colors.bg_highlight = bg_highlight - -- colors.bg_popup = bg_dark - -- colors.bg_search = bg_search - -- colors.bg_sidebar = transparent and colors.none or bg_dark - -- colors.bg_statusline = transparent and colors.none or bg_dark - -- colors.bg_visual = bg_visual - -- colors.border = border - -- colors.fg = fg - -- colors.fg_dark = fg_dark - -- colors.fg_float = fg - -- colors.fg_gutter = fg_gutter - -- colors.fg_sidebar = fg_dark - -- end, - -- }) - -- - -- vim.cmd("colorscheme tokyonight") - -- end, + "ribru17/bamboo.nvim", + lazy = false, + priority = 1000, -- Make sure to load this before all the other start plugins. + config = function() + require("bamboo").setup({ + -- ────────────────────────────< optional configuration here >───────────────────────── + code_style = { + comments = { italic = false, bold = true }, + conditionals = { italic = true }, + keywords = { bold = true }, + functions = {}, + namespaces = { italic = true }, + parameters = { italic = true }, + strings = {}, + variables = { bold = true }, + }, + -- ─< Custom Highlights -- >──────────────────────────────────────────────────────────── + colors = {}, -- Override default colors + highlights = { -- Override highlight groups + ["@comment"] = { fg = "#555653" }, + }, + }) + require("bamboo").load() + end, } diff --git a/lua/pika/plugins/lsp/mason.lua b/lua/pika/plugins/lsp/mason.lua index 748229c..e15e489 100644 --- a/lua/pika/plugins/lsp/mason.lua +++ b/lua/pika/plugins/lsp/mason.lua @@ -1,54 +1,54 @@ return { - "williamboman/mason.nvim", - dependencies = { - "williamboman/mason-lspconfig.nvim", - "WhoIsSethDaniel/mason-tool-installer.nvim", - }, - config = function() - -- import mason - local mason = require("mason") + "williamboman/mason.nvim", + dependencies = { + "williamboman/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + }, + config = function() + -- import mason + local mason = require("mason") - -- import mason-lspconfig - local mason_lspconfig = require("mason-lspconfig") + -- import mason-lspconfig + local mason_lspconfig = require("mason-lspconfig") - local mason_tool_installer = require("mason-tool-installer") + local mason_tool_installer = require("mason-tool-installer") - -- enable mason and configure icons - mason.setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗", - }, - }, - }) + -- enable mason and configure icons + mason.setup({ + ui = { + icons = { + package_installed = "", + package_pending = "➜", + package_uninstalled = "", + }, + }, + }) - mason_lspconfig.setup({ - -- list of servers for mason to install - ensure_installed = { - "tsserver", - "html", - "cssls", - "tailwindcss", - "svelte", - "lua_ls", - "graphql", - "emmet_ls", - "prismals", - "pyright", - }, - }) + mason_lspconfig.setup({ + -- list of servers for mason to install + ensure_installed = { + "tsserver", + "html", + "cssls", + "tailwindcss", + "svelte", + "lua_ls", + "graphql", + "emmet_ls", + "prismals", + "pyright", + }, + }) - mason_tool_installer.setup({ - ensure_installed = { - "prettier", -- prettier formatter - "stylua", -- lua formatter - "isort", -- python formatter - "black", -- python formatter - "pylint", - "eslint_d", - }, - }) - end, + mason_tool_installer.setup({ + ensure_installed = { + "prettier", -- prettier formatter + "stylua", -- lua formatter + -- "isort", -- python formatter + -- "black", -- python formatter + "pylint", + "eslint_d", + }, + }) + end, } diff --git a/lua/pika/plugins/substitute.lua b/lua/pika/plugins/substitute.lua deleted file mode 100644 index b5ff1b6..0000000 --- a/lua/pika/plugins/substitute.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "gbprod/substitute.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local substitute = require("substitute") - - substitute.setup() - - -- set keymaps - local keymap = vim.keymap -- for conciseness - - keymap.set("n", "s", substitute.operator, { desc = "Substitute with motion" }) - keymap.set("n", "ss", substitute.line, { desc = "Substitute line" }) - keymap.set("n", "S", substitute.eol, { desc = "Substitute to end of line" }) - keymap.set("x", "s", substitute.visual, { desc = "Substitute in visual mode" }) - end, -}