Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/lucasvianav/nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvianav committed Aug 8, 2022
2 parents 917b2f1 + 2b8773c commit 6abab74
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 240 deletions.
8 changes: 5 additions & 3 deletions ftplugin/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ vim.api.nvim_command('setlocal spell')

require('v.utils.mappings').set_keybindings({
{ 'i', '<C-i>', '<C-c>xsiw*lf*a' },
{ 'i', '<C-m>', '<C-c>xsiw`lf`a' },
{ 'i', '<C-b>', '<C-c>xsiw*l.l2f*a' },
{ 'i', '<C-S-i>', '<C-c>xsiW*lf*a' },
{ 'i', '<C-S-b>', '<C-c>xsiW*l.l2f*a' },
{ 'i', '<M-i>', '<C-c>xsiW*lf*a' },
{ 'i', '<M-m>', '<C-c>xsiW`lf`a' },
{ 'i', '<M-b>', '<C-c>xsiW*l.l2f*a' },
{ 'v', '<C-i>', 'S*' },
{ 'v', '<C-b>', 'S*gvS*' },
}, {
buffer = true,
noremap = false,
remap = true,
})
6 changes: 2 additions & 4 deletions lua/v/plugins/general/unimpaired.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ local duplicate_line = function(up)
return
end

local cmd = string.rep('copy ' .. (dupl_dir_up and '-1' or '+0') .. ' | ', dupl_count):gsub(
' | $',
''
)
local cmd =
string.rep('copy ' .. (dupl_dir_up and '-1' or '+0') .. ' | ', dupl_count):gsub(' | $', '')
vim.api.nvim_exec('silent!' .. cmd, false)

vim.fn['repeat#set'](t('<Plug>DuplicateLineRepeat'), dupl_count)
Expand Down
125 changes: 66 additions & 59 deletions lua/v/plugins/git/diffview.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
-- TODO: write function to diff between current branch and another one
-- maybe get name from input? origin's default branch?

local cb = require('diffview.config').diffview_callback
local actions = require('diffview.actions')

require('diffview').setup({
diff_binaries = false,
Expand Down Expand Up @@ -31,77 +28,87 @@ require('diffview').setup({
height = 16,
},
log_options = {
max_count = 256, -- Limit the number of commits
follow = false, -- Follow renames (only for single file)
all = false, -- Include all refs under 'refs/' including HEAD
merges = false, -- List only merge commits
no_merges = false, -- List no merge commits
reverse = false, -- List commits in reverse order
single_files = {
max_count = 256, -- Limit the number of commits
follow = true, -- Follow renames (only for single file)
all = false, -- Include all refs under 'refs/' including HEAD
merges = false, -- List only merge commits
no_merges = true, -- List no merge commits
reverse = false, -- List commits in reverse order
},
multi_files = {
max_count = 256,
follow = false,
all = false,
merges = false,
no_merges = true,
reverse = false,
},
},
},

key_bindings = {
disable_defaults = true,

view = {
['<tab>'] = cb('select_next_entry'),
['<s-tab>'] = cb('select_prev_entry'),
['gf'] = cb('goto_file'),
['<C-w><C-f>'] = cb('goto_file_split'),
['<C-w>f'] = cb('goto_file_split'),
['<C-w>gf'] = cb('goto_file_tab'),
['<leader>e'] = cb('focus_files'),
['<leader>b'] = cb('toggle_files'),
['<tab>'] = actions.select_next_entry,
['<s-tab>'] = actions.select_prev_entry,
['gf'] = actions.goto_file,
['<C-w><C-f>'] = actions.goto_file_split,
['<C-w>f'] = actions.goto_file_split,
['<C-w>gf'] = actions.goto_file_tab,
['<leader>e'] = actions.focus_files,
['<leader>b'] = actions.toggle_files,
},

file_panel = {
['j'] = cb('next_entry'),
['k'] = cb('prev_entry'),
['<cr>'] = cb('select_entry'),
['l'] = cb('select_entry'),
['<2-LeftMouse>'] = cb('select_entry'),
['-'] = cb('toggle_stage_entry'),
['s'] = cb('toggle_stage_entry'),
['S'] = cb('stage_all'),
['U'] = cb('unstage_all'),
['X'] = cb('restore_entry'),
['R'] = cb('refresh_files'),
['<tab>'] = cb('select_next_entry'),
['<s-tab>'] = cb('select_prev_entry'),
['gf'] = cb('goto_file'),
['<C-w><C-f>'] = cb('goto_file_split'),
['<C-w>f'] = cb('goto_file_split'),
['<C-w>gf'] = cb('goto_file_tab'),
['i'] = cb('listing_style'), -- toggle between 'list' and 'tree' views
['f'] = cb('toggle_flatten_dirs'),
['<leader>e'] = cb('focus_files'),
['<leader>b'] = cb('toggle_files'),
['j'] = actions.next_entry,
['k'] = actions.prev_entry,
['<cr>'] = actions.select_entry,
['l'] = actions.select_entry,
['<2-LeftMouse>'] = actions.select_entry,
['-'] = actions.toggle_stage_entry,
['s'] = actions.toggle_stage_entry,
['S'] = actions.stage_all,
['U'] = actions.unstage_all,
['X'] = actions.restore_entry,
['R'] = actions.refresh_files,
['<tab>'] = actions.select_next_entry,
['<s-tab>'] = actions.select_prev_entry,
['gf'] = actions.goto_file,
['<C-w><C-f>'] = actions.goto_file_split,
['<C-w>f'] = actions.goto_file_split,
['<C-w>gf'] = actions.goto_file_tab,
['i'] = actions.listing_style, -- toggle between 'list' and 'tree' views
['f'] = actions.toggle_flatten_dirs,
['<leader>e'] = actions.focus_files,
['<leader>b'] = actions.toggle_files,
},

file_history_panel = {
['g!'] = cb('options'),
['<C-A-d>'] = cb('open_in_diffview'),
['y'] = cb('copy_hash'),
['zR'] = cb('open_all_folds'),
['zM'] = cb('close_all_folds'),
['j'] = cb('next_entry'),
['k'] = cb('prev_entry'),
['<cr>'] = cb('select_entry'),
['l'] = cb('select_entry'),
['<2-LeftMouse>'] = cb('select_entry'),
['<tab>'] = cb('select_next_entry'),
['<s-tab>'] = cb('select_prev_entry'),
['gf'] = cb('goto_file'),
['<C-w><C-f>'] = cb('goto_file_split'),
['<C-w>f'] = cb('goto_file_split'),
['<C-w>gf'] = cb('goto_file_tab'),
['<leader>e'] = cb('focus_files'),
['<leader>b'] = cb('toggle_files'),
['g!'] = actions.options,
['<C-A-d>'] = actions.open_in_diffview,
['y'] = actions.copy_hash,
['zR'] = actions.open_all_folds,
['zM'] = actions.close_all_folds,
['j'] = actions.next_entry,
['k'] = actions.prev_entry,
['<cr>'] = actions.select_entry,
['l'] = actions.select_entry,
['<2-LeftMouse>'] = actions.select_entry,
['<tab>'] = actions.select_next_entry,
['<s-tab>'] = actions.select_prev_entry,
['gf'] = actions.goto_file,
['<C-w><C-f>'] = actions.goto_file_split,
['<C-w>f'] = actions.goto_file_split,
['<C-w>gf'] = actions.goto_file_tab,
['<leader>e'] = actions.focus_files,
['<leader>b'] = actions.toggle_files,
},

option_panel = {
['<tab>'] = cb('select'),
['q'] = cb('close'),
['<tab>'] = actions.select_entry,
['q'] = actions.close,
},
},
})
96 changes: 0 additions & 96 deletions lua/v/plugins/lsp/coq.lua

This file was deleted.

11 changes: 6 additions & 5 deletions lua/v/plugins/navigation/nvim-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,21 @@ hl_utils.set_highlights({
{
'NvimTreeRootFolder',
{
gui = { 'bold', 'italic' },
guifg = colors.off_white,
bold = true,
italic = true,
fg = colors.off_white,
},
},
{ 'Directory', { gui = 'bold' } },
{ 'Directory', { bold = true } },
{
'NvimTreeGitDirty',
{ guifg = alter_color(colors.blue_light, -10) },
{ fg = alter_color(colors.blue_light, -10) },
},
{
'NvimTreeOpenedFolderName',
{
gui = { 'bold', 'italic' },
guifg = alter_color(colors.yellow, -10),
fg = alter_color(colors.yellow, -10),
},
},
})
1 change: 1 addition & 0 deletions lua/v/plugins/navigation/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ require('v.utils.mappings').set_keybindings({
{ 'n', '<Leader>fc', builtin.commands },
{ 'n', '<Leader>fch', builtin.command_history },
{ 'n', '<Leader>fj', builtin.jumplist },
{ 'n', 'z=', builtin.spell_suggest },

-- lsp
{ 'n', 'gd', builtin.lsp_definitions },
Expand Down
2 changes: 1 addition & 1 deletion lua/v/plugins/syntax/bullets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ require('v.utils').set_viml_options('bullets', {
renumber_on_change = true,
})

require('v.utils.mappings').map('i', '<S-TAB>', '<C-D>', { noremap = false })
require('v.utils.mappings').map('i', '<S-TAB>', '<C-D>', { remap = true })
20 changes: 10 additions & 10 deletions lua/v/settings/appearance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ M.colorscheme = 'tokyonight'
--- function to be ran after a colorscheme is applied
M.post_colorscheme_hook = function()
require('v.utils.highlights').set_highlights({
-- { 'CursorLine', { guibg = colors.cyan_grey_dark } },
-- { 'ColorColumn', { guibg = colors.cyan_grey_dark } },
{ 'NormalFloat', { link = 'Normal', bang = true } },
{ 'FloatBorder', { 'transparent' } },
{ 'Folded', { 'transparent' } },
{ 'BufferLineFill', { 'transparent' } },
{ 'TabLine', { 'transparent', guifg = colors.cyan_grey } },
{ 'TabLineFill', { 'transparent' } },
-- { 'CursorLine', { bg = colors.cyan_grey_dark } },
-- { 'ColorColumn', { bg = colors.cyan_grey_dark } },
{ 'NormalFloat', { link = 'Normal' } },
{ 'FloatBorder', { transparent = true } },
{ 'Folded', { transparent = true } },
{ 'BufferLineFill', { transparent = true } },
{ 'TabLine', { transparent = true, fg = colors.cyan_grey } },
{ 'TabLineFill', { transparent = true } },
{
'TabLineSel',
{
guibg = colors.grey_dark,
guifg = colors.off_white,
bg = colors.grey_dark,
fg = colors.off_white,
},
},
})
Expand Down
4 changes: 2 additions & 2 deletions lua/v/utils/dailies.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local M = {}

M.daily_time = 11
M.daily_time = 12

---Parse the days to be used in a daily report.
---@param count number
Expand Down Expand Up @@ -51,7 +51,7 @@ local write_report_template_to_file = function(first_day, second_day)
}
vim.api.nvim_buf_set_lines(0, 0, #report_template, false, report_template)
vim.api.nvim_win_set_cursor(0, { 5, 1 })
vim.api.nvim_command('noautocmd w')
vim.api.nvim_command('noautocmd w!')
end

---Open the Markdown document for a daily report inside $WORK_DIR.
Expand Down
Loading

0 comments on commit 6abab74

Please sign in to comment.