add: load new window terminal alacritty

This commit is contained in:
asep komarudin 2024-02-24 18:17:08 +07:00
parent d00563a0a8
commit 1c9deb6b07
5 changed files with 38 additions and 8 deletions

View file

@ -16,7 +16,6 @@
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"friendly-snippets": { "branch": "main", "commit": "dbd45e9ba76d535e4cba88afa1b7aa43bb765336" }, "friendly-snippets": { "branch": "main", "commit": "dbd45e9ba76d535e4cba88afa1b7aa43bb765336" },
"gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" }, "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" },
"gruvbox-baby": { "branch": "main", "commit": "ea71b4225d0140103d99748ca4a33ecf22c03f62" },
"impatient.nvim": { "branch": "main", "commit": "969f2c5c90457612c09cf2a13fee1adaa986d350" }, "impatient.nvim": { "branch": "main", "commit": "969f2c5c90457612c09cf2a13fee1adaa986d350" },
"indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
"lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" }, "lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" },
@ -50,6 +49,7 @@
"smart-splits.nvim": { "branch": "master", "commit": "e1e1e6ca3754bd8ef971fb69673cc17965eb9e37" }, "smart-splits.nvim": { "branch": "master", "commit": "e1e1e6ca3754bd8ef971fb69673cc17965eb9e37" },
"telescope.nvim": { "branch": "master", "commit": "955e50dfed94d28225569d7734eec4c5c65e273f" }, "telescope.nvim": { "branch": "master", "commit": "955e50dfed94d28225569d7734eec4c5c65e273f" },
"toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" },
"tokyonight.nvim": { "branch": "main", "commit": "67c6050e1ca41260c919236a098ba278472c7520" },
"transparent.nvim": { "branch": "main", "commit": "fd35a46f4b7c1b244249266bdcb2da3814f01724" }, "transparent.nvim": { "branch": "main", "commit": "fd35a46f4b7c1b244249266bdcb2da3814f01724" },
"vim-bbye": { "branch": "master", "commit": "903f5eb17f72ebf7b0b1524bbb792c0b36761af6" }, "vim-bbye": { "branch": "master", "commit": "903f5eb17f72ebf7b0b1524bbb792c0b36761af6" },
"vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" },

View file

@ -12,7 +12,7 @@
-- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha -- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
-- dracula -- dracula
-- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox -- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox
vim.g.pcode_colorscheme = "gruvbox-baby" vim.g.pcode_colorscheme = "tokyonight"
-- custom transparent mode -- custom transparent mode
-- only support -- only support
@ -44,7 +44,7 @@ vim.g.pcode_lualine_style = 0
-- 0 = default -- 0 = default
-- 1 = vim icon " " -- 1 = vim icon " "
-- 2 = vim icon " " -- 2 = vim icon " "
vim.g.pcode_status_icon = 1 vim.g.pcode_status_icon = 0
-- start custom lualine style -- start custom lualine style
-- contoh style -- contoh style

View file

@ -16,6 +16,11 @@ function _CLOSE_BUFFER()
require("bufdelete").bufdelete(buf, true) require("bufdelete").bufdelete(buf, true)
end 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 } local term_opts = { silent = true }
-- Shorten function name -- Shorten function name
@ -54,10 +59,15 @@ keymap("v", "<C-Z>", "<esc><cmd>undo<CR>", opts)
keymap("i", "<C-Z>", "<esc><cmd>undo<CR>", opts) keymap("i", "<C-Z>", "<esc><cmd>undo<CR>", opts)
-- create comment CTRL + / all mode -- create comment CTRL + / all mode
keymap("n", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts) keymap("n", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts)
keymap("n", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts)
keymap("v", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts) keymap("v", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts)
keymap("v", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts)
keymap("i", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts) keymap("i", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts)
keymap("i", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts)
keymap("i", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts) keymap("i", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts)
keymap("i", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts)
keymap("n", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts) keymap("n", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts)
keymap("n", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts)
-- keymap("n", "<C-l>", "<esc><cmd>lua _LIVE_SERVER()<cr>", opts) -- keymap("n", "<C-l>", "<esc><cmd>lua _LIVE_SERVER()<cr>", opts)
-- keymap("i", "<C-l>", "<esc><cmd>lua _LIVE_SERVER()<cr>", opts) -- keymap("i", "<C-l>", "<esc><cmd>lua _LIVE_SERVER()<cr>", opts)
@ -126,6 +136,8 @@ keymap("x", "<S-Down>", ":'<,'>t'><cr>", opts)
-- close current buffer -- close current buffer
keymap("n", "<S-t>", "<cmd>lua _CLOSE_BUFFER()<cr>", opts) keymap("n", "<S-t>", "<cmd>lua _CLOSE_BUFFER()<cr>", opts)
-- open alacritty terminal
-- keymap("n", "<A-a>", "<cmd>lua _OPEN_ALACRITTY()<cr>", opts)
-- Visual Block -- -- Visual Block --
-- Move text up and down -- Move text up and down

View file

@ -71,11 +71,12 @@ if data_exists then
local ui_icon = custom_ui.status_icon local ui_icon = custom_ui.status_icon
if ui_icon ~= nil then if ui_icon ~= nil then
if custom_ui.status_icon == 1 then if custom_ui.status_icon == 1 then
icon_mode = "" icon_mode = ""
sts_mode = 1
elseif custom_ui.status_icon == 2 then elseif custom_ui.status_icon == 2 then
icon_mode = "" icon_mode = ""
sts_mode = 1
end end
sts_mode = 1
end end
local custom_style = custom_ui.custom_lualine local custom_style = custom_ui.custom_lualine
if custom_style ~= nil and custom_style == true then if custom_style ~= nil and custom_style == true then
@ -92,11 +93,22 @@ local mode = {
"mode", "mode",
padding = 1, padding = 1,
fmt = function(str) 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 if sts_mode == 0 then
-- return "--" .. str .. "--" -- return "--" .. str .. "--"
return str return "" .. str
else else
-- return icon_mode .. str
return icon_mode return icon_mode
end end
end, end,

View file

@ -69,6 +69,11 @@ function _LIVE_SERVER()
live_server:toggle() live_server:toggle()
end end
function _OPEN_ALACRITTY()
-- open alacritty new windows current directory
vim.cmd("silent !alacritty --working-directory " .. vim.fn.getcwd())
end
local setup = { local setup = {
plugins = { plugins = {
marks = true, -- shows a list of your marks on ' and ` marks = true, -- shows a list of your marks on ' and `
@ -317,6 +322,7 @@ local mappings = {
h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" }, h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" },
v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" }, v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" },
s = { "<cmd>ToggleTerm direction=tab<cr>", "New Tab" }, s = { "<cmd>ToggleTerm direction=tab<cr>", "New Tab" },
a = { "<cmd>lua _OPEN_ALACRITTY()<cr>", "Open Alacritty" },
}, },
r = { r = {
name = "  Run", name = "  Run",