Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #10

Merged
merged 63 commits into from
Feb 1, 2023
Merged

Dev #10

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
e460bbb
[Enh](Lsp): Added gopls langauge server for go.
DeadlySquad13 Jan 6, 2023
bc9d92c
[Enh](Go): Added run command.
DeadlySquad13 Jan 6, 2023
a1611e5
[Enh](Typescript): Added conceals.
DeadlySquad13 Jan 6, 2023
2a5b740
[Enh](Navigation): Added telescope file_browser extension.
DeadlySquad13 Jan 6, 2023
22d016c
[Chore](Settings): Updated indent settings, temporarily removed jukit…
DeadlySquad13 Jan 6, 2023
7f7e676
[Refactor](Exec): Rewrote module to use metatables.
DeadlySquad13 Jan 6, 2023
b222dcf
[Enh](Commands): Added telescope file_browser as picker for choose_an…
DeadlySquad13 Jan 7, 2023
6695862
[Enh](Keymappings): Moved conceal to ','(settings) keymappings, resol…
DeadlySquad13 Jan 7, 2023
70c099a
[Doc](Utils): Changed comments to fit sumneko_lua annotations format.
DeadlySquad13 Jan 7, 2023
c09df6f
[Enh](Treesitter): Added highlight disable on large files.
DeadlySquad13 Jan 7, 2023
1af342a
[Enh](Navigation): Added other.nvim for navigation between alternate …
DeadlySquad13 Jan 7, 2023
5194255
[Refactor](Commands): Removed unused commands from choose_and_edit_ta…
DeadlySquad13 Jan 7, 2023
4001458
[Refactor](Commands^&Utils): Separated concerns.
DeadlySquad13 Jan 7, 2023
bf08744
[Chore]: Cleaned comments.
DeadlySquad13 Jan 7, 2023
3d29786
[Refactor](Integration): Moved configs to subfolder.
DeadlySquad13 Jan 7, 2023
953cf92
[Refactor](Workspace): Moved configs to subfolder.
DeadlySquad13 Jan 7, 2023
21a2ce1
[Refactor](WindowManagement): Moved configs to subfolder.
DeadlySquad13 Jan 7, 2023
4689bf4
[Refactor](Navigation): Moved configs to subfolder.
DeadlySquad13 Jan 7, 2023
f6c7bec
[Refactor](Editing): Moved configs to subfolder.
DeadlySquad13 Jan 7, 2023
4c169e2
[Refactor](Lsp): Moved configs to subfolder.
DeadlySquad13 Jan 7, 2023
2033471
[Refactor](Lsp): Moved configs to subfolder.
DeadlySquad13 Jan 7, 2023
475996f
[Refactor](ProjectManagement): Moved configs to subfolder.
DeadlySquad13 Jan 7, 2023
9f23236
[Fix](Editing): Moved to proper folder.
DeadlySquad13 Jan 7, 2023
e7f2a8e
[Refactor](Ui): Moved configs to subfolder.
DeadlySquad13 Jan 7, 2023
6e8e2ed
[Fix](Ui): Changed require path.
DeadlySquad13 Jan 8, 2023
be2103b
[Enh](Telescope): Added require of the file_browser config to extensi…
DeadlySquad13 Jan 8, 2023
d4a56ab
[Fix](Utils): Added formatting of buf name for windows paths.
DeadlySquad13 Jan 8, 2023
754de4e
[Enh](Incline): Added difference between focused and unfocused windows.
DeadlySquad13 Jan 8, 2023
8ad7015
[Enh](Commands): Removed file_browser from choose_and_edit_target as …
DeadlySquad13 Jan 8, 2023
be3bedd
[Enh](GeneralSettings): Changed cmdheight to 0.
DeadlySquad13 Jan 8, 2023
ff59776
[Fix](ChooseAndEditTargets): Added fallback for opts value.
DeadlySquad13 Jan 8, 2023
f4bb3ed
[Enh](Layers): Added more modularity into config.
DeadlySquad13 Jan 8, 2023
b385ec0
[Enh](TextObjects): Added treesitter-text-objects.
DeadlySquad13 Jan 17, 2023
09e3869
[Enh](Lspsaga): Moved to setup
DeadlySquad13 Jan 26, 2023
20b277f
[Enh](Workspace): Added scope for buffer management.
DeadlySquad13 Jan 26, 2023
1743ce0
[Fix](Keymappings__Buffer): Added cmd to keymappings.
DeadlySquad13 Jan 26, 2023
9a75611
[Refactor](GeneralSettings): Moved powershell settings to separate ob…
DeadlySquad13 Jan 26, 2023
0739373
[Enh](Editing): Added telescope-undo plugin.
DeadlySquad13 Jan 26, 2023
10c7403
[Style](NullLs): Removed @see from comment.
DeadlySquad13 Jan 27, 2023
0ec13e8
[Refactor](Plugins): Removed comments with plugins that will not be u…
DeadlySquad13 Jan 27, 2023
b08fb67
[Style](NullLs): Removed @see from comment.
DeadlySquad13 Jan 27, 2023
89d3bbd
[Refactor](Plugins): Removed comments with plugins that will not be u…
DeadlySquad13 Jan 27, 2023
29a0991
[Enh](Logging): Added plugin for debuglogging, connected it with corr…
DeadlySquad13 Jan 27, 2023
fb7d05e
[Enh](GeneralSettings): Added options to shortmess and adjusted repor…
DeadlySquad13 Jan 28, 2023
1964bb9
Merge branch 'dev' of https://github.com/DeadlySquad13/NeoVim_config …
DeadlySquad13 Jan 28, 2023
db758ee
[Enh](Navigation): Added leap.
DeadlySquad13 Jan 28, 2023
53e486b
[Enh](Leap): Removed some labels.
DeadlySquad13 Jan 28, 2023
d6a3c02
[Enh](Navigation): Added flit.
DeadlySquad13 Jan 28, 2023
1cc32be
[Enh](Leap): Added multi_normal command.
DeadlySquad13 Jan 28, 2023
ebcf127
[Refactor](DsOmegaUtils): Separated simple_plugin_setup into atomic u…
DeadlySquad13 Jan 28, 2023
32e1e3e
[Enh](Leap): Changed keymappings in operator in visual modes to z/Z a…
DeadlySquad13 Jan 28, 2023
c2f4b47
[Enh](Flit): Disabled multiline as it crosses with leap.
DeadlySquad13 Jan 28, 2023
0538ddc
[Enh](Navigation): Added sj.nvim.
DeadlySquad13 Jan 29, 2023
ae9c4ff
[Enh](Sj): Added keymappings.
DeadlySquad13 Jan 29, 2023
4e55538
[Enh](GeneralSettings): Added guicursor setting.
DeadlySquad13 Jan 29, 2023
1ae923e
[Enh](Navigation): Added syntax-tree-surfer.
DeadlySquad13 Jan 29, 2023
93e61da
[Enh](GeneralSettings): Made listchars less distracting.
DeadlySquad13 Jan 29, 2023
36c6518
Merge branch 'dev' of https://github.com/DeadlySquad13/NeoVim_config …
DeadlySquad13 Jan 29, 2023
3da2187
[Fix](Lua): Forked lua ftplugin and added in this repo.
DeadlySquad13 Jan 29, 2023
8956b02
[Enh](Lua): Added tabstop.
DeadlySquad13 Jan 29, 2023
ec332d0
[Fix](Lspsaga): Added keymappings back.
DeadlySquad13 Feb 1, 2023
33722df
[Fix](Merge): Resolved conflicts.
DeadlySquad13 Feb 1, 2023
94b94d5
[Fix](Merge): Removed mistakes after resolved conflicts.
DeadlySquad13 Feb 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion after/ftplugin/lua
Submodule lua updated from 9ced5f to 8ddd63
5 changes: 5 additions & 0 deletions init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,8 @@ func AppendSome()
" return cmd
endfunc

" Highlight only leading whitespace characters.
highlight WhiteSpaceLeading guifg=#918278
highlight WhiteSpace guifg=#efe0b9
match WhiteSpace / /
2match WhiteSpaceLeading /^ \+/
27 changes: 27 additions & 0 deletions lua/config/Editing/undo.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
local undo_actions = require("telescope-undo.actions")

return {
-- use_custom_command = { 'cmd.exe', '/c', [[echo $DIFF | delta]]}, -- setting this implies `use_delta = false`. Accepted format is: { "bash", "-c", "echo '$DIFF' | delta" }
use_custom_command = { 'pwsh.exe', '-NoProfile', '-Command', 'echo "$DIFF" | delta'}, -- setting this implies `use_delta = false`. Accepted format is: { "bash", "-c", "echo '$DIFF' | delta" }
side_by_side = true, -- Available only with delta.
layout_strategy = 'vertical',
layout_config = {
preview_height = 0.8,
},

diff_context_lines = vim.o.scrolloff,
entry_format = 'state #$ID, $STAT, $TIME',

mappings = {
i = {
-- IMPORTANT: Note that telescope-undo must be available when telescope is configured if
-- you want to replicate these defaults and use the following actions. This means
-- installing as a dependency of telescope in it's `requirements` and loading this
-- extension from there instead of having the separate plugin definition as outlined
-- above.
["<C-y>"] = undo_actions.yank_additions,
-- ["<C-y>"] = undo_actions.yank_deletions,
["<Cr>"] = undo_actions.restore,
},
},
}
2 changes: 1 addition & 1 deletion lua/config/Lsp/completion/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local window_visuals = require('config.lsp.completion.window_visuals')
local formatting = require('config.lsp.completion.formatting')
local keymappings = require('config.lsp.completion.keymappings')

local MIN_KEYWORD_LENGTH = 4
local MIN_KEYWORD_LENGTH = 2

cmp.setup({
window = window_visuals,
Expand Down
21 changes: 20 additions & 1 deletion lua/config/Lsp/lspsaga.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- change the lsp symbol kind
local lspkind = require('lspsaga.lspkind')
-- local lspkind = require('lspsaga.lspkind')

return {
-- ???
Expand Down Expand Up @@ -87,4 +87,23 @@ return {
-- the related filetypes into this table
-- like server_filetype_map = { metals = { "sbt", "scala" } }
server_filetype_map = {},

ui = {
-- Currently, only the round theme exists
theme = "round",
-- This option only works in Neovim 0.9
title = true,
-- Border type can be single, double, rounded, solid, shadow.
border = "solid",
winblend = 0,
expand = "⮚ ",
collapse = "⮛ ",
preview = "👁 ", -- Eye: U+1F441.
code_action = "💡",
diagnostic = "🐞 ",
incoming = "📨 ", -- Incoming envelope: U+1F4E8.
outgoing = "✉ ", -- Envelope: ^Vu2709.
hover = '🔍 ', -- Left-Pointing Magnifying Glass: U+1F50D.
kind = {},
}
}
2 changes: 1 addition & 1 deletion lua/config/Lsp/null_ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ return {
formatting.stylua,

-- General
---@see [misspell](https://github.com/client9/misspell).
-- see [misspell](https://github.com/client9/misspell).
-- diagnostics.misspell,

-- Typescript
Expand Down
9 changes: 9 additions & 0 deletions lua/config/Navigation/flit.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
local leap_settings = require('config.Navigation.leap.settings')

return {
labeled_modes = 'vo',
multiline = false,
opts = {
safe_labels = leap_settings.safe_labels,
}
}
8 changes: 8 additions & 0 deletions lua/config/Navigation/leap/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
return {
settings = require('config.Navigation.leap.settings'),
keymappings = require('config.Navigation.leap.keymappings'),

commands = {
multi_normal = require('config.Navigation.leap.multi_normal'),
}
}
17 changes: 17 additions & 0 deletions lua/config/Navigation/leap/keymappings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- See [second proposal](https://github.com/ggandor/leap.nvim/discussions/41):
-- abcd| |bcde
-- ████e ← Zab zde → █████ (this might also be the desired behavior for Visual `s` - see below)
-- ab██e ← Xab xde → ███de
local keymappings = {
z = { '<Plug>(leap-forward-to)', 'Leap forward to' },
Z = { '<Plug>(leap-backward-to)', 'Leap backward to' },

-- 'x' for exclusive.
x = { '<Plug>(leap-forward-till)', 'Leap forward till' },
X = { '<Plug>(leap-backward-till)', 'Leap backward till' },
}

return {
o = keymappings,
x = keymappings,
}
56 changes: 56 additions & 0 deletions lua/config/Navigation/leap/multi_normal.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
local prequire = require('utils').prequire

local leap_is_available, leap = prequire('leap')

if not leap_is_available then
return
end

-- see [multi-cursor ':normal'](https://github.com/ggandor/leap.nvim#calling-leap-with-custom-arguments)
-- The following example showcases a custom action, using `multiselect`. We're
-- executing a `normal!` command at each selected position (this could be even
-- more useful if we'd pass in custom targets too).
function multi_normal(targets)
-- Get the :normal sequence to be executed.
local input = vim.fn.input("normal! ")
if #input < 1 then return end

local ns = vim.api.nvim_create_namespace("")

-- Set an extmark as an anchor for each target, so that we can also execute
-- commands that modify the positions of other targets (insert/change/delete).
for _, target in ipairs(targets) do
local line, col = unpack(target.pos)
id = vim.api.nvim_buf_set_extmark(0, ns, line - 1, col - 1, {})
target.extmark_id = id
end

-- Jump to each extmark (anchored to the "moving" targets), and execute the
-- command sequence.
for _, target in ipairs(targets) do
local id = target.extmark_id
local pos = vim.api.nvim_buf_get_extmark_by_id(0, ns, id, {})
vim.fn.cursor(pos[1] + 1, pos[2] + 1)
vim.cmd("normal! " .. input)
end

-- Clean up the extmarks.
vim.api.nvim_buf_clear_namespace(0, ns, 0, -1)
end

-- Usage:
local create_user_command = require('config.commands.utils').create_user_command

create_user_command(
'MultiNormal',
function()
leap.leap({
target_windows = { vim.fn.win_getid() },
action = multi_normal,
multiselect = true,
})
end,
{ nargs = 0 }
)

return multi_normal
30 changes: 30 additions & 0 deletions lua/config/Navigation/leap/settings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
return {
max_phase_one_targets = nil,
highlight_unlabeled_phase_one_targets = true,
max_highlighted_traversal_targets = 10,
case_sensitive = true,
equivalence_classes = { ' \t\r\n' },
substitute_chars = { ['\r'] = '¬' },
safe_labels = {
's', 'f', 'n', 'u', 't', '/',
'S', 'F', 'N', 'L', 'H', 'M', 'U', 'G', 'T', '?', 'Z',
},
labels = {
's', 'f',
'j', 'k', 'l', 'h', 'o', 'd', 'w', 'e', 'm',
'v', 'r', 'c', 'x', '/', 'z',
'S', 'F',
'J', 'K', 'L', 'H', 'O', 'D', 'W', 'E', 'M',
'V', 'R', 'C', 'X', '?', 'Z',
},
special_keys = {
repeat_search = '<enter>',
next_phase_one_target = '<enter>',
next_target = {'<enter>', ';'},
prev_target = {'<tab>', ','},
next_group = '<space>',
prev_group = '<tab>',
multi_accept = '<enter>',
multi_revert = '<backspace>',
},
}
4 changes: 4 additions & 0 deletions lua/config/Navigation/sj/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
return {
settings = require('config.Navigation.sj.settings'),
keymappings = require('config.Navigation.sj.keymappings'),
}
24 changes: 24 additions & 0 deletions lua/config/Navigation/sj/keymappings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
local prequire = require('utils').prequire

local sj_is_available, sj = prequire('sj')

if not sj_is_available then
return
end

-- Keymappings used during the search are in settings.
return {
n = {
['/'] = { sj.run, 'Search and jump' },
['?'] = { function() sj.run({ forward_search = false }) end, 'Search and jump backwards' },
['<Leader>'] = {
-- Default bindings that we have overriden in case you just want to iterate over search results.
['/'] = { '/', 'Search' },
['?'] = { '?', 'Search backwards' },

-- Like a leap but a little bit different.
s = { function() sj.run({ search_scope = 'visible_lines' }) end, 'Search and jump across visible lines' },
S = { function() sj.run({ search_scope = 'visible_lines', forward_search = false }) end, 'Search and jump across visible lines backwards' },
},
},
}
19 changes: 19 additions & 0 deletions lua/config/Navigation/sj/settings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local leap_settings = require('config.Navigation.leap.settings')

return {
auto_jump = false,
separator = ';', -- Character used to split the user input in <pattern> and <label> (can be empty).
use_overlay = false, -- If true, apply an overlay to better identify labels and matches.
labels = leap_settings.labels,
relative_labels = true, -- if true, labels are ordered from the cursor position,
update_search_register = true, -- If true, update the search register with the last used pattern.
-- Can be: current_line, visible_lines_above, visible_lines_below, visible_lines, buffer.
search_scope = 'buffer', -- To align more with default / and ?

keymaps = {
prev_pattern = "<C-k>", -- Select the previous pattern while searching.
next_pattern = "<C-j>", -- Select the next pattern while searching.

send_to_qflist = "<C-q>", --- Send the search results to the quickfix list.
}
}
4 changes: 4 additions & 0 deletions lua/config/Navigation/syntax_tree_surfer/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
return {
settings = require('config.Navigation.syntax_tree_surfer.settings'),
keymappings = require('config.Navigation.syntax_tree_surfer.keymappings'),
}
58 changes: 58 additions & 0 deletions lua/config/Navigation/syntax_tree_surfer/keymappings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
return {
n = {
v = {
-- Normal Mode Swapping.
U = {
function()
vim.opt.opfunc = 'v:lua.STSSwapUpNormal_Dot'
return 'g@l'
end,
'Swap up the master node relative to the cursor with its siblings',
expr = true,
},
D = {
function()
vim.opt.opfunc = 'v:lua.STSSwapDownNormal_Dot'
return 'g@l'
end,
'Swap down the master node relative to the cursor with its siblings',
expr = true,
},

-- Swap Current Node at the Cursor with it's siblings, Dot Repeatable
d = {
function()
vim.opt.opfunc = 'v:lua.STSSwapCurrentNodeNextNormal_Dot'
return 'g@l'
end,
'Swap current node with next',
expr = true,
},
u = {
function()
vim.opt.opfunc = 'v:lua.STSSwapCurrentNodePrevNormal_Dot'
return 'g@l'
end,
'Swap current node with previous',
expr = true,
},


-- Visual Selection from Normal Mode.
x = { '<Cmd>STSSelectMasterNode<Cr>', 'Select master node' },
n = { '<Cmd>STSSelectCurrentNode<Cr>', 'Select current node' },
},
},

x = {
-- Select Nodes in Visual Mode
J = { '<Cmd>STSSelectNextSiblingNode<Cr>', 'Select next sibling node' },
K = { '<Cmd>STSSelectPrevSiblingNode<Cr>', 'Select previous sibling node' },
H = { '<Cmd>STSSelectParentNode<Cr>', 'Select parent node' },
L = { '<Cmd>STSSelectChildNode<Cr>', 'select child node' },

-- Swapping Nodes in Visual Mode
['<A-j>'] = { '<Cmd>STSSwapNextVisual<Cr>', 'Swap with next node' },
['<A-k>'] = { '<Cmd>STSSwapPrevVisual<Cr>', 'Swap with previous node' },
}
}
1 change: 1 addition & 0 deletions lua/config/Navigation/syntax_tree_surfer/settings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
return {}
3 changes: 2 additions & 1 deletion lua/config/Navigation/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ return {
},

extensions = {
file_browser = require('config.Navigation.telescope_file_browser')
file_browser = require('config.Navigation.telescope_file_browser'),
undo = require('config.Editing.undo'),
}
}
2 changes: 1 addition & 1 deletion lua/config/commands/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local choose_and_edit_target = require('config.commands.choose_and_edit_target')
local create_user_command = require('config.commands.utils').create_user_command

---@see `:h user-commands` and `:h nvim_create_user_command()`.
-- See `:h user-commands` and `:h nvim_create_user_command()`.

create_user_command(
'ChooseAndEditConfigs',
Expand Down
9 changes: 5 additions & 4 deletions lua/config/keymappings/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ return {
name = 'Buffer',

-- Deletes buffer without closing vim if it was in the only window.
d = { ':Bdelete<cr>', 'Delete' },
d = { '<Cmd>Bdelete<Cr>', 'Delete' },
D = { '<Cmd>%bdelete|edit#<Cr>', 'Delete all buffer except for current one' },

---@see{the lua api at @link{https://github.com/akinsho/bufferline.nvim/blob/main/lua/bufferline.lua}}
--see the [lua api](https://github.com/akinsho/bufferline.nvim/blob/main/lua/bufferline.lua)
--p = { function() bufferline.pick_buffer() end, 'Pick' },
p = { '<cmd>BufferLinePick<cr>', 'Pick' },
n = { 'bn', 'Next' },
p = { '<Cmd>BufferLinePick<Cr>', 'Pick' },
n = { '<Cmd>bnext<Cr>', 'Next' },
}
4 changes: 4 additions & 0 deletions lua/config/treesitter/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ local incremental_selection = require_treesitter_configuration(
)
local rainbow = require_treesitter_configuration('rainbow')

local textobjects = require_treesitter_configuration('textobjects')

-- List of language that will be disabled
local DISABLED_HIGHLIGHT_FILETYPES = {
'css',
Expand Down Expand Up @@ -54,6 +56,8 @@ tree_sitter.setup({
-- Brackets.
rainbow = rainbow,

textobjects = textobjects,

context_commentstring = {
enable = true,
-- Disable the CursorHold autocommand of this plugin to work with
Expand Down
Loading