added toggleterm, color lualine
parent
4f73f56d3b
commit
8330555c19
|
@ -19,17 +19,34 @@ local new_colors = {
|
|||
}
|
||||
|
||||
-- change nightlfy theme colors
|
||||
lualine_nightfly.normal.a.bg = new_colors.blue
|
||||
lualine_nightfly.insert.a.bg = new_colors.red
|
||||
lualine_nightfly.visual.a.bg = new_colors.violet
|
||||
lualine_nightfly.normal.a.fg = new_colors.blue
|
||||
lualine_nightfly.insert.a.fg = new_colors.red
|
||||
lualine_nightfly.visual.a.fg = new_colors.violet
|
||||
lualine_nightfly.command = {
|
||||
a = {
|
||||
gui = "bold",
|
||||
bg = new_colors.yellow,
|
||||
fg = new_colors.black, -- black
|
||||
fg = new_colors.yellow,
|
||||
bg = '', -- black
|
||||
},
|
||||
}
|
||||
|
||||
lualine_nightfly.normal.a.bg = ''
|
||||
lualine_nightfly.insert.a.bg = ''
|
||||
lualine_nightfly.visual.a.bg = ''
|
||||
|
||||
lualine_nightfly.normal.b.bg = ''
|
||||
lualine_nightfly.insert.b.bg = ''
|
||||
lualine_nightfly.visual.b.bg = ''
|
||||
|
||||
lualine_nightfly.normal.b.bg = ''
|
||||
lualine_nightfly.normal.c.bg = ''
|
||||
lualine_nightfly.command = {
|
||||
a = {
|
||||
gui = "bold",
|
||||
bg = '',
|
||||
fg = new_colors.yellow, -- black
|
||||
},
|
||||
}
|
||||
-- configure lualine with modified theme
|
||||
lualine.setup({
|
||||
options = {
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
-- import toggleterm plugin safely
|
||||
local toggleterm_setup, toggleterm = pcall(require, "toggleterm")
|
||||
if not toggleterm_setup then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
toggleterm.setup({
|
||||
open_mapping = [[<M-3>]],
|
||||
size = 20,
|
||||
-- open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
persist_size = true,
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = {buffer = 0}
|
||||
vim.keymap.set('t', '<esc>', [[<M-3><C-n>]], opts)
|
||||
vim.keymap.set('t', 'jk', [[<M-3><C-n>]], opts)
|
||||
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-w>', [[<M-3><C-n><C-w>]], opts)
|
||||
end
|
||||
|
||||
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
||||
|
||||
function _LAZYGIT_TOGGLE()
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
local node = Terminal:new({ cmd = "node", hidden = true })
|
||||
|
||||
function _NODE_TOGGLE()
|
||||
node:toggle()
|
||||
end
|
||||
|
||||
local python = Terminal:new({ cmd = "python3", hidden = true })
|
||||
|
||||
function _PYTHON_TOGGLE()
|
||||
python:toggle()
|
||||
end
|
Loading…
Reference in New Issue