2023-07-03 02:27:02 +04:00
|
|
|
local opts = { noremap = true, silent = true }
|
|
|
|
|
|
|
|
vim.g.mapleader = " "
|
|
|
|
vim.g.maplocalleader = " "
|
|
|
|
|
|
|
|
vim.opt.backspace = "2"
|
|
|
|
vim.opt.showcmd = true
|
|
|
|
vim.opt.laststatus = 2
|
|
|
|
vim.opt.autowrite = true
|
|
|
|
vim.opt.cursorline = true
|
|
|
|
vim.opt.autoread = true
|
|
|
|
|
|
|
|
-- spaces for tabs
|
|
|
|
vim.opt.tabstop = 2
|
|
|
|
vim.opt.shiftwidth = 2
|
|
|
|
vim.opt.shiftround = true
|
|
|
|
vim.opt.expandtab = true
|
|
|
|
|
|
|
|
-- split position
|
|
|
|
vim.opt.splitbelow = true
|
|
|
|
vim.opt.splitright = true
|
|
|
|
|
|
|
|
-- :terminal shell
|
|
|
|
if (vim.loop.os_uname().sysname == "Linux")
|
|
|
|
then
|
2023-07-29 21:45:44 +04:00
|
|
|
vim.opt.shell = "zsh"
|
2023-08-11 00:18:17 +04:00
|
|
|
else
|
2023-07-03 02:27:02 +04:00
|
|
|
vim.opt.shell = "pwsh"
|
|
|
|
end
|
|
|
|
|
|
|
|
-- nvimtree
|
|
|
|
vim.keymap.set("n", "<leader>e", ":NvimTreeFindFileToggle<CR>", opts)
|
|
|
|
|
|
|
|
-- splits
|
|
|
|
vim.keymap.set("n", "<c-k>", ":wincmd k<CR>", opts)
|
|
|
|
vim.keymap.set("n", "<c-j>", ":wincmd j<CR>", opts)
|
|
|
|
vim.keymap.set("n", "<c-h>", ":wincmd h<CR>", opts)
|
|
|
|
vim.keymap.set("n", "<c-l>", ":wincmd l<CR>", opts)
|
|
|
|
|
|
|
|
-- resize split
|
|
|
|
vim.keymap.set("n", "<Left>", ":vertical resize +1<CR>", opts)
|
|
|
|
vim.keymap.set("n", "<Right>", ":vertical resize -1<CR>", opts)
|
|
|
|
vim.keymap.set("n", "<Up>", ":resize -1<CR>", opts)
|
|
|
|
vim.keymap.set("n", "<Down>", ":resize +1<CR>", opts)
|
|
|
|
|
|
|
|
-- make split
|
|
|
|
vim.keymap.set("n", "nsv", ":vsplit<CR>", opts)
|
|
|
|
vim.keymap.set("n", "nsh", ":split<CR>", opts)
|
|
|
|
|
|
|
|
-- terminal
|
2023-08-11 00:18:17 +04:00
|
|
|
--vim.keymap.set("n", "<leader>t", ":split<CR> <BAR> :terminal<CR>")
|
|
|
|
vim.keymap.set("n", "<leader>t", ":FloatermToggle<CR>")
|
2023-08-11 00:30:24 +04:00
|
|
|
vim.keymap.set("n", "<leader>g", ":FloatermNew --height=29 --width=120 lazygit<CR>")
|
2023-07-03 02:27:02 +04:00
|
|
|
|
|
|
|
-- exit terminal with esc
|
|
|
|
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", opts)
|
2023-07-29 21:45:44 +04:00
|
|
|
|
|
|
|
-- color picker
|
|
|
|
vim.keymap.set("n", "<C-c>", "<cmd>PickColor<cr>", opts)
|
|
|
|
vim.keymap.set("i", "<C-c>", "<cmd>PickColorInsert<cr>", opts)
|