1
0
Fork 0

Major config changes

Add alacritty config, as it is my main terminal now
Change **a lot** of nvim configs
Add tmux configuration
Update zsh configs
Add .gitconfig with custom pager
Include tmux-plugin-manager as a submodule
This commit is contained in:
Arthur Khachaturov 2023-12-06 04:42:30 +03:00
parent bb8a0eaec7
commit 90ca95ad38
No known key found for this signature in database
GPG key ID: 542ADA2564CCFDDB
23 changed files with 529 additions and 51 deletions

View file

@ -15,9 +15,9 @@ end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
-- Resotre cursor on exit
vim.api.nvim_create_autocmd("VimLeave", {
pattern = "*",
callback = function()
vim.o.guicursor = "n:ver20-blinkwait700-blinkoff400-blinkon250"
end,
})
-- vim.api.nvim_create_autocmd("VimLeave", {
-- pattern = "*",
-- callback = function()
-- vim.o.guicursor = "n:ver20-blinkwait700-blinkoff400-blinkon250"
-- end,
-- })

View file

@ -1,39 +1,25 @@
local map = vim.keymap.set
-- Unbind used keys
-- Unbind keys
map('n', '<C-q>', '<NOP>')
-- Movements between splits
map('n', '<C-h>', '<C-w>h')
map('n', '<C-j>', '<C-w>j')
map('n', '<C-k>', '<C-w>k')
map('n', '<C-l>', '<C-w>l')
map('v', 'K', '<NOP>')
-- Movement between buffers
map({'n', 'v', 'i'}, '<A-h>', ':bp<CR>')
map({'n', 'v', 'i'}, '<A-l>', ':bn<CR>')
map({'n', 'v', 'i'}, '<A-u>', ':bp<CR>')
map({'n', 'v', 'i'}, '<A-i>', ':bn<CR>')
-- Remap for dealing with word wrap
map('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
map('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map('n', 'k', 'v:count == 0 ? "gk" : "k"', { expr = true, silent = true })
map('n', 'j', 'v:count == 0 ? "gj" : "j"', { expr = true, silent = true })
-- Exit buffers/nvim with <leader>
map("n", "<leader>q", function() require('utils.close_buffer').close_buffer() end)
map("n", "<leader><C-q>", function() require('utils.close_buffer').close_buffer(true) end)
map("n", "<leader>Q", ":%bd | quit<CR>")
map("n", "<leader>w", ":write<CR>")
map('n', '<leader>q', function() require('utils.close_buffer').close_buffer() end)
map('n', '<leader><C-q>', function() require('utils.close_buffer').close_buffer(true) end)
map('n', '<leader>Q', ':%bd | quit<CR>')
map('n', '<leader>w', ':write<CR>')
-- Copy and paste from clipboard
map("n", "<leader>y", '"+yy')
map("v", "<leader>y", '"+y')
map({ "n", "v" }, "<leader>p", '"+p')
map({ "n", "v" }, "<leader>P", '"+P')
-- Remap comments
map("n", "<C-_>", require("Comment.api").toggle.linewise.current)
map("i", "<C-_>", require("Comment.api").toggle.linewise.current)
map("x", "<C-_>", function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<ESC>', true, false, true), 'nx', false)
require("Comment.api").toggle.linewise(vim.fn.visualmode())
end
)
map('n', '<leader>y', '"+yy<ESC>')
map('v', '<leader>y', '"+y<ESC>')
map({ 'n', 'v' }, '<leader>p', '"+p<ESC>')
map({ 'n', 'v' }, '<leader>P', '"+P<ESC>')

View file

@ -27,5 +27,8 @@ vim.o.timeoutlen = 300
-- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect'
-- NOTE: You should make sure your terminal supports this
-- Enable TrueColor
vim.o.termguicolors = true
vim.o.splitbelow = true
vim.o.splitright = true

View file

@ -0,0 +1,67 @@
require("cmake-tools").setup {
cmake_command = "cmake", -- this is used to specify cmake command path
cmake_regenerate_on_save = true, -- auto generate when save CMakeLists.txt
cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" }, -- this will be passed when invoke `CMakeGenerate`
cmake_build_options = {}, -- this will be passed when invoke `CMakeBuild`
-- support macro expansion:
-- ${kit}
-- ${kitGenerator}
-- ${variant:xx}
cmake_build_directory = "cmake-build-${variant:buildType}", -- this is used to specify generate directory for cmake, allows macro expansion
cmake_soft_link_compile_commands = false, -- this will automatically make a soft link from compile commands file to project root dir
cmake_compile_commands_from_lsp = false, -- this will automatically set compile commands file location using lsp, to use it, please set `cmake_soft_link_compile_commands` to false
cmake_kits_path = nil, -- this is used to specify global cmake kits path, see CMakeKits for detailed usage
cmake_variants_message = {
short = { show = true }, -- whether to show short message
long = { show = true, max_length = 40 }, -- whether to show long message
},
cmake_dap_configuration = { -- debug settings for cmake
name = "cpp",
type = "codelldb",
request = "launch",
stopOnEntry = false,
runInTerminal = true,
console = "integratedTerminal",
},
cmake_executor = { -- executor to use
name = "quickfix", -- name of the executor
opts = {}, -- the options the executor will get, possible values depend on the executor type. See `default_opts` for possible values.
default_opts = { -- a list of default and possible values for executors
quickfix = {
show = "always", -- "always", "only_on_error"
position = "belowright", -- "bottom", "top"
size = 10,
},
overseer = {
new_task_opts = {}, -- options to pass into the `overseer.new_task` command
on_new_task = function(task) end, -- a function that gets overseer.Task when it is created, before calling `task:start`
},
terminal = {}, -- terminal executor uses the values in cmake_terminal
},
},
cmake_terminal = {
name = "terminal",
opts = {
name = "Main Terminal",
prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name
split_direction = "horizontal", -- "horizontal", "vertical"
split_size = 11,
-- Window handling
single_terminal_per_instance = true, -- Single viewport, multiple windows
single_terminal_per_tab = true, -- Single viewport per tab
keep_terminal_static_location = true, -- Static location of the viewport if avialable
-- Running Tasks
start_insert_in_launch_task = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun
start_insert_in_other_tasks = false, -- If you want to enter terminal with :startinsert upon launching all other cmake tasks in the terminal. Generally set as false
focus_on_main_terminal = false, -- Focus on cmake terminal when cmake task is launched. Only used if executor is terminal.
focus_on_launch_terminal = false, -- Focus on cmake launch terminal when executable target in launched.
},
},
cmake_notifications = {
enabled = true, -- show cmake execution progress in nvim-notify
spinner = { "", "", "", "", "", "", "", "", "", "" }, -- icons used for progress display
refresh_rate_ms = 100, -- how often to iterate icons
},
}

View file

@ -0,0 +1,9 @@
local map = vim.keymap.set
map('n', '<C-_>', require('Comment.api').toggle.linewise.current)
map('i', '<C-_>', require('Comment.api').toggle.linewise.current)
map('x', '<C-_>', function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<ESC>', true, false, true), 'nx', false)
require('Comment.api').toggle.linewise(vim.fn.visualmode())
end
)

View file

@ -1,6 +1,9 @@
require("config.plugins.lualine")
require("config.plugins.nvim-autopairs")
require("config.plugins.nvim-cmp")
require("config.plugins.nvim-tree")
require("config.plugins.telescope")
require("config.plugins.treesitter")
require('config.plugins.cmake-tools')
require('config.plugins.comment')
require('config.plugins.lualine')
require('config.plugins.nvim-autopairs')
require('config.plugins.nvim-cmp')
require('config.plugins.nvim-tree')
require('config.plugins.telescope')
require('config.plugins.treesitter')
require('config.plugins.navigator')

View file

@ -0,0 +1,8 @@
require('Navigator').setup()
local map = vim.keymap.set
map('n', '<A-h>', function () require("Navigator").left() end)
map('n', '<A-j>', function () require("Navigator").down() end)
map('n', '<A-k>', function () require("Navigator").up() end)
map('n', '<A-l>', function () require("Navigator").right() end)

View file

@ -1,3 +1,6 @@
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
require("nvim-tree").setup()
vim.keymap.set('n', '<C-b>', ':NvimTreeToggle<CR>')

View file

@ -1,14 +1,16 @@
return {
'numToStr/Navigator.nvim',
'tpope/vim-fugitive',
'tpope/vim-rhubarb',
'tpope/vim-sleuth',
'nvim-tree/nvim-web-devicons',
"nvim-tree/nvim-tree.lua",
'nvim-lualine/lualine.nvim',
'tpope/vim-surround',
'tmux-plugins/vim-tmux',
'nvim-lualine/lualine.nvim',
'nvim-tree/nvim-tree.lua',
'nvim-tree/nvim-web-devicons',
'Civitasv/cmake-tools.nvim',
{ 'numToStr/Comment.nvim', opts = {} },
{ 'akinsho/bufferline.nvim', config = {} },
{ 'ethanholz/nvim-lastplace', config = {} },
{ "akinsho/bufferline.nvim", config = {} },
{ 'wakatime/vim-wakatime', event = 'VeryLazy' },
}

View file

@ -0,0 +1,7 @@
-- return {
-- 'aserowy/tmux.nvim',
-- event = "VeryLazy",
-- }
return {
"numToStr/Navigator.nvim",
}