From 1c9deb6b0760a576015b87b4811d21cf4d3d8b48 Mon Sep 17 00:00:00 2001 From: asep komarudin Date: Sat, 24 Feb 2024 18:17:08 +0700 Subject: [PATCH] add: load new window terminal alacritty --- lazy-lock.json | 2 +- lua/custom/default.lua | 4 ++-- lua/user/keymaps.lua | 12 ++++++++++++ lua/user/lualine.lua | 22 +++++++++++++++++----- lua/user/whichkey.lua | 6 ++++++ 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 5b9ebdc..3a03af7 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -16,7 +16,6 @@ "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "friendly-snippets": { "branch": "main", "commit": "dbd45e9ba76d535e4cba88afa1b7aa43bb765336" }, "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" }, - "gruvbox-baby": { "branch": "main", "commit": "ea71b4225d0140103d99748ca4a33ecf22c03f62" }, "impatient.nvim": { "branch": "main", "commit": "969f2c5c90457612c09cf2a13fee1adaa986d350" }, "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" }, @@ -50,6 +49,7 @@ "smart-splits.nvim": { "branch": "master", "commit": "e1e1e6ca3754bd8ef971fb69673cc17965eb9e37" }, "telescope.nvim": { "branch": "master", "commit": "955e50dfed94d28225569d7734eec4c5c65e273f" }, "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, + "tokyonight.nvim": { "branch": "main", "commit": "67c6050e1ca41260c919236a098ba278472c7520" }, "transparent.nvim": { "branch": "main", "commit": "fd35a46f4b7c1b244249266bdcb2da3814f01724" }, "vim-bbye": { "branch": "master", "commit": "903f5eb17f72ebf7b0b1524bbb792c0b36761af6" }, "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, diff --git a/lua/custom/default.lua b/lua/custom/default.lua index 691b827..05fa6da 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -12,7 +12,7 @@ -- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha -- dracula -- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox -vim.g.pcode_colorscheme = "gruvbox-baby" +vim.g.pcode_colorscheme = "tokyonight" -- custom transparent mode -- only support @@ -44,7 +44,7 @@ vim.g.pcode_lualine_style = 0 -- 0 = default -- 1 = vim icon " " -- 2 = vim icon " " -vim.g.pcode_status_icon = 1 +vim.g.pcode_status_icon = 0 -- start custom lualine style -- contoh style diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index 073be38..4d10602 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -16,6 +16,11 @@ function _CLOSE_BUFFER() require("bufdelete").bufdelete(buf, true) end +function _OPEN_ALACRITTY() + -- open alacritty new windows current directory + vim.cmd("silent !alacritty --working-directory " .. vim.fn.getcwd()) +end + local term_opts = { silent = true } -- Shorten function name @@ -54,10 +59,15 @@ keymap("v", "", "undo", opts) keymap("i", "", "undo", opts) -- create comment CTRL + / all mode keymap("n", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) +keymap("n", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) keymap("v", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) +keymap("v", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) keymap("i", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) +keymap("i", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) keymap("i", "", "lua require('Comment.api').toggle.linewise.current()i", opts) +keymap("i", "", "lua require('Comment.api').toggle.linewise.current()i", opts) keymap("n", "", "lua require('Comment.api').toggle.linewise.current()i", opts) +keymap("n", "", "lua require('Comment.api').toggle.linewise.current()i", opts) -- keymap("n", "", "lua _LIVE_SERVER()", opts) -- keymap("i", "", "lua _LIVE_SERVER()", opts) @@ -126,6 +136,8 @@ keymap("x", "", ":'<,'>t'>", opts) -- close current buffer keymap("n", "", "lua _CLOSE_BUFFER()", opts) +-- open alacritty terminal +-- keymap("n", "", "lua _OPEN_ALACRITTY()", opts) -- Visual Block -- -- Move text up and down diff --git a/lua/user/lualine.lua b/lua/user/lualine.lua index 84dafa9..ded64e6 100644 --- a/lua/user/lualine.lua +++ b/lua/user/lualine.lua @@ -71,11 +71,12 @@ if data_exists then local ui_icon = custom_ui.status_icon if ui_icon ~= nil then if custom_ui.status_icon == 1 then - icon_mode = "" + icon_mode = " " + sts_mode = 1 elseif custom_ui.status_icon == 2 then - icon_mode = "" + icon_mode = " " + sts_mode = 1 end - sts_mode = 1 end local custom_style = custom_ui.custom_lualine if custom_style ~= nil and custom_style == true then @@ -92,11 +93,22 @@ local mode = { "mode", padding = 1, fmt = function(str) + -- if str == "NORMAL" then + -- str = "NOR" + -- elseif str == "INSERT" then + -- str = "INS" + -- elseif str == "VISUAL" then + -- str = "VIS" + -- elseif str == "COMMAND" then + -- str = "CMD" + -- else + -- str = str + -- end + if sts_mode == 0 then -- return "--" .. str .. "--" - return str + return " " .. str else - -- return icon_mode .. str return icon_mode end end, diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua index 62c8c1e..afce198 100644 --- a/lua/user/whichkey.lua +++ b/lua/user/whichkey.lua @@ -69,6 +69,11 @@ function _LIVE_SERVER() live_server:toggle() end +function _OPEN_ALACRITTY() + -- open alacritty new windows current directory + vim.cmd("silent !alacritty --working-directory " .. vim.fn.getcwd()) +end + local setup = { plugins = { marks = true, -- shows a list of your marks on ' and ` @@ -317,6 +322,7 @@ local mappings = { h = { "ToggleTerm size=10 direction=horizontal", "Horizontal" }, v = { "ToggleTerm size=80 direction=vertical", "Vertical" }, s = { "ToggleTerm direction=tab", "New Tab" }, + a = { "lua _OPEN_ALACRITTY()", "Open Alacritty" }, }, r = { name = "  Run",