Compare commits

..

No commits in common. "689f994fbdabd144b019b456a22b2ef70eefe43c" and "9fb7d5de4bc8a3fe4e76e830bfe034ab1e4f9d5d" have entirely different histories.

10 changed files with 149 additions and 169 deletions

View File

@ -0,0 +1,8 @@
-- Set keymap to open chat in browser
vim.keymap.set('n', '<leader>cc', ':execute codeium#Chat()<Enter>', { desc = '[C]odeium [C]hat' })
return {
-- Free Github Copilot alternative
'Exafunction/codeium.vim',
event = 'BufEnter',
}

View File

@ -5,42 +5,40 @@ vim.g.conflict_marker_highlight_group = ''
vim.g.conflict_marker_begin = '^<<<<<<< .*$'
vim.g.conflict_marker_end = '^>>>>>>> .*$'
-- Highlight groups
vim.cmd 'highlight ConflictMarkerBegin guibg=#2f7366'
vim.cmd 'highlight ConflictMarkerOurs guibg=#2e5049'
vim.cmd 'highlight ConflictMarkerTheirs guibg=#344f69'
vim.cmd 'highlight ConflictMarkerEnd guibg=#2f628e'
vim.cmd 'highlight ConflictMarkerCommonAncestorsHunk guibg=#754a81'
-- Git conflict marker management plugin
return {
{
'rhysd/conflict-marker.vim',
config = function()
-- Highlight groups
vim.cmd 'highlight ConflictMarkerBegin guibg=#2f7366'
vim.cmd 'highlight ConflictMarkerOurs guibg=#2e5049'
vim.cmd 'highlight ConflictMarkerTheirs guibg=#344f69'
vim.cmd 'highlight ConflictMarkerEnd guibg=#2f628e'
vim.cmd 'highlight ConflictMarkerCommonAncestorsHunk guibg=#754a81'
-- Read all lines in buffer, check if there is any conflict marker
function git_conflict_detection()
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
-- Check if strict regex is contained in any line
local beginning = vim.fn.match(lines, vim.g.conflict_marker_begin)
local ending = vim.fn.match(lines, vim.g.conflict_marker_end)
local enabled = vim.diagnostic.is_enabled()
if (beginning > -1 or ending > -1) and enabled then
vim.diagnostic.enable(false)
elseif not enabled then
vim.diagnostic.enable(true)
end
'rhysd/conflict-marker.vim',
config = function()
-- Read all lines in buffer, check if there is any conflict marker
function git_conflict_detection()
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
-- Check if strict regex is contained in any line
local beginning = vim.fn.match(lines, vim.g.conflict_marker_begin)
local ending = vim.fn.match(lines, vim.g.conflict_marker_end)
local enabled = vim.diagnostic.is_enabled()
if (beginning > -1 or ending > -1) and enabled then
vim.diagnostic.enable(false)
elseif not enabled then
vim.diagnostic.enable(true)
end
end
-- Autocommand to disable diagnostics on buffer enter
vim.api.nvim_create_autocmd('BufRead', {
group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = true }),
callback = git_conflict_detection,
})
-- Autocommand to disable diagnostics on save
vim.api.nvim_create_autocmd('BufWritePre', {
group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = false }),
callback = git_conflict_detection,
})
end,
},
-- Autocommand to disable diagnostics on buffer enter
vim.api.nvim_create_autocmd('BufRead', {
group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = true }),
callback = git_conflict_detection,
})
-- Autocommand to disable diagnostics on save
vim.api.nvim_create_autocmd('BufWritePre', {
group = vim.api.nvim_create_augroup('git-conflict-lsp-disable', { clear = false }),
callback = git_conflict_detection,
})
end,
}

View File

@ -1,26 +1,23 @@
-- Switch in fugitive.vim status window with the current one
vim.keymap.set('n', '<leader>gs', '<cmd>Gedit :<cr>', { desc = '[G]it [S]tatus' })
-- Fetch all changes
vim.keymap.set('n', '<leader>gF', '<cmd>Git fetch<cr>', { desc = '[G]it [F]etch' })
-- Push changes
vim.keymap.set('n', '<leader>gP', '<cmd>Git push<cr>', { desc = '[G]it [P]ush' })
-- Pull changes
vim.keymap.set('n', '<leader>gp', '<cmd>Git pull<cr>', { desc = '[G]it [P]ull' })
-- Open history graph
vim.keymap.set('n', '<leader>gl', '<cmd>Flogsplit<cr><cmd>wincmd k<cr><cmd>q<cr>', { desc = '[G]it [L]og' })
return {
{
-- Git related plugins
'tpope/vim-fugitive',
dependencies = {
{
'rbong/vim-flog',
lazy = true,
cmd = { 'Flogsplit' },
},
'idanarye/vim-merginal',
-- Git related plugins
'tpope/vim-fugitive',
dependencies = {
{
'rbong/vim-flog',
lazy = true,
cmd = { 'Flogsplit' },
},
config = function()
-- Switch in fugitive.vim status window with the current one
vim.keymap.set('n', '<leader>gs', '<cmd>Gedit :<cr>', { desc = '[G]it [S]tatus' })
-- Fetch all changes
vim.keymap.set('n', '<leader>gF', '<cmd>Git fetch<cr>', { desc = '[G]it [F]etch' })
-- Push changes
vim.keymap.set('n', '<leader>gP', '<cmd>Git push<cr>', { desc = '[G]it [P]ush' })
-- Pull changes
vim.keymap.set('n', '<leader>gp', '<cmd>Git pull<cr>', { desc = '[G]it [P]ull' })
-- Open history graph
vim.keymap.set('n', '<leader>gl', '<cmd>Flogsplit<cr><cmd>wincmd k<cr><cmd>q<cr>', { desc = '[G]it [L]og' })
end,
'idanarye/vim-merginal',
},
}

View File

@ -1,6 +1,4 @@
-- Plugin to intelligently reopen files at last edit position
return {
{
'farmergreg/vim-lastplace',
},
'farmergreg/vim-lastplace',
}

View File

@ -1,15 +1,13 @@
return {
{
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = vim.g.have_nerd_font,
theme = 'catppuccin',
section_separators = { left = '', right = '' },
component_separators = { left = '', right = '' },
},
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = vim.g.have_nerd_font,
theme = 'catppuccin',
section_separators = { left = '', right = '' },
component_separators = { left = '', right = '' },
},
},
}

View File

@ -1,12 +1,10 @@
-- Markdown preview plugin
return {
{
'iamcco/markdown-preview.nvim',
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
build = 'cd app; npm install',
init = function()
vim.g.mkdp_filetypes = { 'markdown' }
end,
ft = { 'markdown' },
},
'iamcco/markdown-preview.nvim',
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
build = 'cd app; npm install',
init = function()
vim.g.mkdp_filetypes = { 'markdown' }
end,
ft = { 'markdown' },
}

View File

@ -1,30 +1,28 @@
-- Smooth scroll plugin and keymaps
return {
{
'karb94/neoscroll.nvim',
enabled = not vim.g.neovide,
config = function()
require('neoscroll').setup {
hide_cursor = false,
easing_function = nil,
respect_scrolloff = true,
}
'karb94/neoscroll.nvim',
enabled = not vim.g.neovide,
config = function()
require('neoscroll').setup {
hide_cursor = false,
easing_function = nil,
respect_scrolloff = true,
}
require('neoscroll.config').set_mappings {
-- Scroll normally
['<C-u>'] = { 'scroll', { '-vim.wo.scroll', 'true', '50' } },
['<C-d>'] = { 'scroll', { 'vim.wo.scroll', 'true', '50' } },
-- Scroll entire page height
['<C-b>'] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '80' } },
['<C-f>'] = { 'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '80' } },
-- Scroll 10% at a time
['<C-y>'] = { 'scroll', { '-0.10', 'false', '25' } },
['<C-e>'] = { 'scroll', { '0.10', 'false', '25' } },
-- Jump to top, bottom and center
['zt'] = { 'zt', { '40' } },
['zz'] = { 'zz', { '50' } },
['zb'] = { 'zb', { '40' } },
}
end,
},
require('neoscroll.config').set_mappings {
-- Scroll normally
['<C-u>'] = { 'scroll', { '-vim.wo.scroll', 'true', '50' } },
['<C-d>'] = { 'scroll', { 'vim.wo.scroll', 'true', '50' } },
-- Scroll entire page height
['<C-b>'] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '80' } },
['<C-f>'] = { 'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '80' } },
-- Scroll 10% at a time
['<C-y>'] = { 'scroll', { '-0.10', 'false', '25' } },
['<C-e>'] = { 'scroll', { '0.10', 'false', '25' } },
-- Jump to top, bottom and center
['zt'] = { 'zt', { '40' } },
['zz'] = { 'zz', { '50' } },
['zb'] = { 'zb', { '40' } },
}
end,
}

View File

@ -9,25 +9,12 @@ vim.api.nvim_create_autocmd('BufLeave', {
})
return {
{
'stevearc/oil.nvim',
-- Optional dependencies
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
local oil = require 'oil'
oil.setup {
view_options = {
show_hidden = true,
},
}
vim.keymap.set('n', '<leader>fe', function()
if vim.bo.filetype == 'oil' then
oil.close()
else
oil.open()
end
end, { desc = '[F]ile [E]xplorer' })
end,
},
'stevearc/oil.nvim',
opts = {},
-- Optional dependencies
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require('oil').setup()
vim.keymap.set('n', '<leader>fe', require('oil').open, { desc = '[F]ile [E]xplorer' })
end,
}

View File

@ -1,49 +1,47 @@
return {
{
-- Simple task runner plugin
'stevearc/overseer.nvim',
opts = {},
config = function()
local overseer = require 'overseer'
overseer.setup {
templates = {
'builtin',
'golang.run_project',
'golang.run_file',
-- Simple task runner plugin
'stevearc/overseer.nvim',
opts = {},
config = function()
local overseer = require 'overseer'
overseer.setup {
templates = {
'builtin',
'golang.run_project',
'golang.run_file',
},
task_list = {
bindings = {
['<C-h>'] = false,
['<C-j>'] = false,
['<C-k>'] = false,
['<C-l>'] = false,
['q'] = false,
},
task_list = {
bindings = {
['<C-h>'] = false,
['<C-j>'] = false,
['<C-k>'] = false,
['<C-l>'] = false,
['q'] = false,
},
},
}
},
}
-- Reference: overseer.nvim/lua/overseer/window.lua
local function is_open()
for _, winid in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
local bufnr = vim.api.nvim_win_get_buf(winid)
if vim.bo[bufnr].filetype == 'OverseerList' then
return true
end
-- Reference: overseer.nvim/lua/overseer/window.lua
local function is_open()
for _, winid in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
local bufnr = vim.api.nvim_win_get_buf(winid)
if vim.bo[bufnr].filetype == 'OverseerList' then
return true
end
return false
end
return false
end
-- Display status info about tasks
vim.keymap.set('n', '<leader>ol', function()
overseer.toggle { winid = 0 }
if is_open() then
vim.cmd.winc '_'
else
vim.api.nvim_buf_delete(vim.api.nvim_get_current_buf(), {})
end
end, { desc = '[O]verseer [L]og' })
-- Run task by listing all in floating
vim.keymap.set('n', '<leader>or', '<cmd>OverseerRun<cr>', { desc = '[O]verseer [R]un' })
end,
},
-- Display status info about tasks
vim.keymap.set('n', '<leader>ol', function()
overseer.toggle { winid = 0 }
if is_open() then
vim.cmd.winc '_'
else
vim.api.nvim_buf_delete(vim.api.nvim_get_current_buf(), {})
end
end, { desc = '[O]verseer [L]og' })
-- Run task by listing all in floating
vim.keymap.set('n', '<leader>or', '<cmd>OverseerRun<cr>', { desc = '[O]verseer [R]un' })
end,
}

View File

@ -4,7 +4,7 @@
-- For more options, you can see `:help option-list`
-- Set display language
vim.cmd 'language en_US'
vim.cmd('language en_US', {})
-- Shell options
-- Sets the shell to use for system() and ! commands in windows