From 03afba17b53657ecc9fdde3de9eeeaef79ebbba4 Mon Sep 17 00:00:00 2001 From: pika Date: Tue, 25 Jun 2024 21:17:47 +0200 Subject: [PATCH] made bar fit more perfect and changed keymaps slightly --- lua/pika/core/keymaps.lua | 104 ++++++++++++++----------- lua/pika/plugins/lualine.lua | 132 ++++++++++++++++---------------- lua/pika/plugins/treesitter.lua | 2 - 3 files changed, 124 insertions(+), 114 deletions(-) diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index cdcda84..b88730a 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -1,4 +1,4 @@ -vim.g.mapleader = ' ' +vim.g.mapleader = " " -- ─< lua/keymaps.lua >───────────────────────────────────────────────────────────────── -- local nomap = vim.keymap.del @@ -7,73 +7,85 @@ vim.g.mapleader = ' ' local map = vim.keymap.set +map("n", "", "nohlsearch") + -- ─< Comment >───────────────────────────────────────────────────────────────────────── -map('n', '', 'gcc', { desc = 'comment toggle', remap = true }) -map('v', '', 'gc', { desc = 'comment toggle', remap = true }) +map("n", "", "gcc", { desc = "comment toggle", remap = true }) +map("v", "", "gc", { desc = "comment toggle", remap = true }) -- ─< Terminal >──────────────────────────────────────────────────────────────────────── -map('t', '', '', { desc = 'terminal escape terminal mode' }) +map("t", "", "", { desc = "terminal escape terminal mode" }) -- ─< Movement while in "insert"-mode >───────────────────────────────────────────────── -map('i', '', '^i', { desc = 'move beginning of line' }) -map('i', '', '', { desc = 'move end of line' }) -map('i', '', '', { desc = 'move left' }) -map('i', '', '', { desc = 'move right' }) -map('i', '', '', { desc = 'move down' }) -map('i', '', '', { desc = 'move up' }) +map("i", "", "^i", { desc = "move beginning of line" }) +map("i", "", "", { desc = "move end of line" }) +map("i", "", "", { desc = "move left" }) +map("i", "", "", { desc = "move right" }) +map("i", "", "", { desc = "move down" }) +map("i", "", "", { desc = "move up" }) -- ───────────────────────────────────< Add yours here >─────────────────────────────────── -map('n', ';', ':', { desc = 'CMD enter command mode' }) -map('i', 'jk', '') -map('i', '', '') -map('n', '', '') -map('v', '', '') +map("n", ";", ":", { desc = "CMD enter command mode" }) +map("i", "jk", "") +map("i", "", "") +map("n", "", "") +map("v", "", "") -map('n', 'x', 'bd!') +map("n", "x", "bd!") -- ─< Activate color plugin >─────────────────────────────────────────────────────────── -map('n', 'C', 'ColorizerToggle') +map("n", "C", "ColorizerToggle") --─< Toggle NvimTree >───────────────────────────────────────────────────────────────── -map('n', 'e', ':NvimTreeToggle', { noremap = true, silent = true, desc = '[e]xplorer' }) +map("n", "e", ":NvimTreeToggle", { noremap = true, silent = true, desc = "[e]xplorer" }) -- ─< Disable arrow keys in normal mode >─────────────────────────────────────────────── -map('n', '', 'echo "Use h to move!!"') -map('n', '', 'echo "Use l to move!!"') -map('n', '', 'echo "Use k to move!!"') -map('n', '', 'echo "Use j to move!!"') +map("n", "", 'echo "Use h to move!!"') +map("n", "", 'echo "Use l to move!!"') +map("n", "", 'echo "Use k to move!!"') +map("n", "", 'echo "Use j to move!!"') -map('n', 'l', '', { desc = 'Move focus to the right window' }) -map('n', 'h', '', { desc = 'Move focus to the left window' }) -map('n', 'j', '', { desc = 'Move focus to the lower window' }) -map('n', 'k', '', { desc = 'Move focus to the upper window' }) +map("n", "l", "", { desc = "Move focus to the right window" }) +map("n", "h", "", { desc = "Move focus to the left window" }) +map("n", "j", "", { desc = "Move focus to the lower window" }) +map("n", "k", "", { desc = "Move focus to the upper window" }) -map('n', 'p', vim.cmd.Ex) -map('n', 'q', vim.cmd.q) -map('n', 's', vim.cmd.w) +-- map("n", "p", vim.cmd.Ex) +map("n", "q", vim.cmd.q) +map("n", "s", vim.cmd.w) -- ─< Comment-Box mappings >──────────────────────────────────────────────────────────── -map('n', 'cd', 'CBd', { noremap = true, silent = true, desc = '[c]ommentbox [d]elete' }) -map('v', 'cd', 'CBd', { noremap = true, silent = true, desc = '[c]ommentbox [d]elete' }) +map("n", "cd", "CBd", { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" }) +map("v", "cd", "CBd", { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" }) -map('n', 'cy', 'CBy', { noremap = true, silent = true, desc = '[y]ank content of Commentbox' }) -map('v', 'cy', 'CBy', { noremap = true, silent = true, desc = '[y]ank content of Commentbox' }) +map("n", "cy", "CBy", { noremap = true, silent = true, desc = "[y]ank content of Commentbox" }) +map("v", "cy", "CBy", { noremap = true, silent = true, desc = "[y]ank content of Commentbox" }) -map('n', 'cb', 'CBlabox1', { noremap = true, silent = true, desc = '[c]reate comment [b]ox' }) -map('v', 'cb', 'CBlabox1', { noremap = true, silent = true, desc = '[c]reate comment [b]ox' }) -map('n', 'cB', 'CBcabox1', { noremap = true, silent = true, desc = '[c]reate comment [b]ox (B)centered' }) -map('v', 'cB', 'CBcabox1', { noremap = true, silent = true, desc = '[c]reate comment [b]ox (B)centered' }) -map('n', 'cc', 'CBllbox14', { noremap = true, silent = true, desc = '[c]reate [c]omment' }) -map('v', 'cc', 'CBllbox14', { noremap = true, silent = true, desc = '[c]reate [c]omment' }) -map('n', 'cC', 'CBclbox14', { noremap = true, silent = true, desc = '[c]reate [c]omment (C)entered' }) -map('v', 'cC', 'CBclbox14', { noremap = true, silent = true, desc = '[c]reate [c]omment (C)entered' }) +map("n", "cb", "CBlabox1", { noremap = true, silent = true, desc = "[c]reate comment [b]ox" }) +map("v", "cb", "CBlabox1", { noremap = true, silent = true, desc = "[c]reate comment [b]ox" }) +map( + "n", + "cB", + "CBcabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } +) +map( + "v", + "cB", + "CBcabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } +) +map("n", "cc", "CBllbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment" }) +map("v", "cc", "CBllbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment" }) +map("n", "cC", "CBclbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" }) +map("v", "cC", "CBclbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" }) -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' }) +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" }) -- ─< LoremIpsum generator >──────────────────────────────────────────────────────────── -map('n', 'L', ':LoremIpsum ') +map("n", "L", ":LoremIpsum ") -- window management -map('n', 'sv', 'v', { desc = 'Split window vertically' }) -- split window vertically -map('n', 'sh', 's', { desc = 'Split window horizontally' }) -- split window horizontally +map("n", "sv", "v", { desc = "Split window vertically" }) -- split window vertically +map("n", "sh", "s", { desc = "Split window horizontally" }) -- split window horizontally diff --git a/lua/pika/plugins/lualine.lua b/lua/pika/plugins/lualine.lua index 4c56fea..bbb0851 100644 --- a/lua/pika/plugins/lualine.lua +++ b/lua/pika/plugins/lualine.lua @@ -1,71 +1,71 @@ return { - 'nvim-lualine/lualine.nvim', - dependencies = { 'nvim-tree/nvim-web-devicons' }, - config = function() - local lualine = require 'lualine' - local lazy_status = require 'lazy.status' -- to configure lazy pending updates count + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + local lualine = require("lualine") + local lazy_status = require("lazy.status") -- to configure lazy pending updates count - local colors = { - blue = '#57a5e5', - green = '#70c2be', - violet = '#aaaaff', - yellow = '#dbb651', - red = '#e75a7c', - fg = '#f1e9dc', - bg = '#252623', - inactive_bg = '#3a3d37', - } + local colors = { + blue = "#57a5e5", + green = "#70c2be", + violet = "#aaaaff", + yellow = "#dbb651", + red = "#e75a7c", + fg = "#f1e9dc", + bg = "#31332e", + inactive_bg = "#3a3d37", + } - local my_lualine_theme = { - normal = { - a = { bg = colors.blue, fg = colors.bg, gui = 'bold' }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - insert = { - a = { bg = colors.green, fg = colors.bg, gui = 'bold' }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - visual = { - a = { bg = colors.violet, fg = colors.bg, gui = 'bold' }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - command = { - a = { bg = colors.yellow, fg = colors.bg, gui = 'bold' }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - replace = { - a = { bg = colors.red, fg = colors.bg, gui = 'bold' }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - inactive = { - a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = 'bold' }, - b = { bg = colors.inactive_bg, fg = colors.semilightgray }, - c = { bg = colors.inactive_bg, fg = colors.semilightgray }, - }, - } + local my_lualine_theme = { + normal = { + a = { bg = colors.blue, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + insert = { + a = { bg = colors.green, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + visual = { + a = { bg = colors.violet, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + command = { + a = { bg = colors.yellow, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + replace = { + a = { bg = colors.red, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + inactive = { + a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" }, + b = { bg = colors.inactive_bg, fg = colors.semilightgray }, + c = { bg = colors.inactive_bg, fg = colors.semilightgray }, + }, + } - -- configure lualine with modified theme - lualine.setup { - options = { - theme = my_lualine_theme, - }, - sections = { - lualine_x = { - { - lazy_status.updates, - cond = lazy_status.has_updates, - color = { fg = '#ff9e64' }, - }, - { 'encoding' }, - { 'fileformat' }, - { 'filetype' }, - }, - }, - } - end, + -- configure lualine with modified theme + lualine.setup({ + options = { + theme = my_lualine_theme, + }, + sections = { + lualine_x = { + { + lazy_status.updates, + cond = lazy_status.has_updates, + color = { fg = "#ff9e64" }, + }, + { "encoding" }, + { "fileformat" }, + { "filetype" }, + }, + }, + }) + end, } diff --git a/lua/pika/plugins/treesitter.lua b/lua/pika/plugins/treesitter.lua index de7be85..b555b8f 100644 --- a/lua/pika/plugins/treesitter.lua +++ b/lua/pika/plugins/treesitter.lua @@ -38,13 +38,11 @@ return { "json", "javascript", "typescript", - "tsx", "graphql", "lua", "query", "c", "prisma", - "svelte", "hyprlang", "ini", "passwd",