Skip to content

Commit

Permalink
Upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Ddystopia committed May 30, 2023
1 parent d68a353 commit 6d76ef6
Show file tree
Hide file tree
Showing 16 changed files with 361 additions and 44 deletions.
2 changes: 1 addition & 1 deletion Config/alacritty/alacritty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ scrolling:
history: 100000

selection:
save_to_clipboard: true
save_to_clipboard: true

cursor:
unfocused_hollow: true
Expand Down
11 changes: 11 additions & 0 deletions Config/gtk-2.0/gtkfilechooser.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Filechooser Settings]
LocationMode=path-bar
ShowHidden=false
ShowSizeColumn=true
GeometryX=254
GeometryY=69
GeometryWidth=948
GeometryHeight=647
SortColumn=name
SortOrder=ascending
StartupMode=recent
1 change: 1 addition & 0 deletions Config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" },
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
"nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" },
"nvim-dap": { "branch": "master", "commit": "debd7c2f80eaf20c5f5df25db8d8c1b9b18f4421" },
"nvim-lspconfig": { "branch": "master", "commit": "255e07ce2a05627d482d2de77308bba51b90470c" },
"nvim-lsputils": { "branch": "master", "commit": "ae1a4a62449863ad82c70713d5b6108f3a07917c" },
"nvim-surround": { "branch": "main", "commit": "e6047128e57c1aff1566fb9f627521d2887fc77a" },
Expand Down
26 changes: 26 additions & 0 deletions Config/nvim/lua/maps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ function ToggleWrap()
end
end

function ToggleCenteredScroll()
if vim.g.centered_cursor then
vim.api.nvim_del_keymap('n', 'j')
vim.api.nvim_del_keymap('n', 'k')
vim.g.centered_cursor = false
else
Map('n', 'j', 'jzz')
Map('n', 'k', 'kzz')
vim.g.centered_cursor = true
end
end

-- TODO: not work
function QuitNetrw()
for i = 1, vim.fn.bufnr('$') do
Expand Down Expand Up @@ -60,6 +72,18 @@ Map('n', '<C-d>', '<C-d>zz');
Map('n', 'n', 'nzz');
Map('n', 'N', 'Nzz');

Map('n', 'U', '<C-r>');

-- Map('n', 'w', 'vw');
-- Map('n', 'W', 'vW');
-- Map('n', 'b', 'vb');
-- Map('n', 'B', 'vB');
-- Map('n', 'e', 've');
-- Map('n', 'E', 'vE');

-- Map('n', 'j', 'jzz');
-- Map('n', 'k', 'kzz');

Map('n', 'gF', ':e <cfile><cr>')

Map('n', '<leader>w', ':w!<cr>')
Expand All @@ -75,6 +99,8 @@ Map('n', '>', '>>')
Map('n', '<', '<<')
Map('n', '$', 'g_')
Map('v', '$', 'g_')
Map('n', 'gl', 'g_')
Map('v', 'gl', 'g_')
Map('n', '<leader>vv', ':e $MYVIMRC<cr>')
Map('n', '<leader>vr', ':luafile %<cr>')
Map('n', 'gp', 'p`[')
Expand Down
26 changes: 18 additions & 8 deletions Config/nvim/lua/opts.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require "utils"

vim.g.centered_cursor = false

vim.opt.hidden = true
vim.opt.swapfile = false
vim.opt.foldenable = false
Expand All @@ -10,15 +12,23 @@ vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.scrolloff = 3

vim.cmd "au BufRead,BufNewFile *.py setlocal tabstop=4 softtabstop=4 shiftwidth=4"
vim.cmd "au BufRead,BufNewFile *.rs setlocal tabstop=4 softtabstop=4 shiftwidth=4"
AutoCommand("BufEnter", function()
vim.opt.formatoptions = vim.opt.formatoptions - { "c", "r", "o" }
end)

AutoCommand({ "BufRead", "BufNewFile" }, function(args)
SetLocalOption(args.buf, 'tabstop', 4)
SetLocalOption(args.buf, 'softtabstop', 4)
SetLocalOption(args.buf, 'shiftwidth', 4)
end, {
pattern = { "*.py", "*.rs" }
})

AutoCommand({ "BufReadPost", "BufNewFile", "BufEnter" }, DisableSyntaxOnLargeFiles, {
group = vim.api.nvim_create_augroup("DisableSyntaxOnLargeFiles", {}),
desc = 'Disable syntax on large files'
})

vim.cmd [[
augroup DisableSyntaxOnLargeFiles
autocmd!
autocmd BufReadPost,BufNewFile,BufEnter * lua DisableSyntaxOnLargeFiles()
augroup END
]]

vim.opt.fileencoding = 'utf-8'

Expand Down
78 changes: 59 additions & 19 deletions Config/nvim/lua/plugins.lua
Original file line number Diff line number Diff line change
@@ -1,25 +1,63 @@
local M = {
{
'mfussenegger/nvim-dap',
keys = { '<leader>dc', '<leader>dr', '<leader>db', '<leader>dl', '<leader>du', '<leader>di', '<leader>ds',
'<leader>dt', '<leader>do', '<leader>dn', '<leader>dp' },
config = function()
local dap = require('dap')
-- Toggle breakpoint
Map('n', '<leader>db', function() require 'dap'.toggle_breakpoint() end)

-- Continue execution
Map('n', '<leader>dc', function() require 'dap'.continue() end)

-- Step over
Map('n', '<leader>do', function() require 'dap'.step_over() end)

-- Step into
Map('n', '<leader>di', function() require 'dap'.step_into() end)

-- Step out
Map('n', '<leader>dt', function() require 'dap'.step_out() end)

-- Open REPL
Map('n', '<leader>dr', function() require 'dap'.repl.open() end)

-- Up stack frame
Map('n', '<leader>du', function() require 'dap'.up() end)

-- Stop
Map('n', '<leader>ds', function() require 'dap'.stop() end)

-- Pause
Map('n', '<leader>ds', function() require 'dap'.pause() end)

-- Widget UI (Check dap-widgets documentation for the correct function)
-- Map('n', '<leader>dw', function() require'dap'.widgets.open() end)
end

},
{
'gelguy/wilder.nvim',
lazy = false,
dependencies = {
'romgrk/fzy-lua-native', 'kyazdani42/nvim-web-devicons',
-- 'liuchengxu/vim-clap'
},
build = function () vim.cmd [[ UpdateRemotePlugins ]] end,
build = function() vim.cmd [[ UpdateRemotePlugins ]] end,
config = function()
local wilder = require('wilder')
wilder.setup({ modes = { ':', '/', '?' } })

wilder.set_option('pipeline', {
wilder.branch(wilder.python_file_finder_pipeline({
file_command = function (_, arg)
file_command = function(_, arg)
if arg ~= nil and arg[0] == '.' then
return { 'fd', '-tf', '-H' }
end
return { 'fd', '-tf' } -- fd -tf -I
end,
dir_command = function (_, arg)
dir_command = function(_, arg)
if arg ~= nil and arg[0] == '.' then
return { 'fd', '-td', '-H' }
end
Expand Down Expand Up @@ -113,7 +151,7 @@ local M = {
end
}, --
{
-- bar at the top
-- bar at the top
'akinsho/nvim-bufferline.lua',
lazy = false,
dependencies = 'kyazdani42/nvim-web-devicons',
Expand Down Expand Up @@ -156,7 +194,7 @@ local M = {
end
}, --
{
-- indent blankline
-- indent blankline
'lukas-reineke/indent-blankline.nvim',
enabled = false,
lazy = false,
Expand All @@ -172,13 +210,13 @@ local M = {
end
}, --
{
-- highlights yank
-- highlights yank
'machakann/vim-highlightedyank',
lazy = false,
config = function() vim.g.highlightedyank_highlight_duration = 250 end
}, --
{
-- colorize colors like this #01dd99
-- colorize colors like this #01dd99
'norcalli/nvim-colorizer.lua',
lazy = false,
config = function()
Expand Down Expand Up @@ -272,10 +310,12 @@ local M = {
Map('i', 'Э', 'Э')
Map('i', 'Ё', 'Ё')
end
}, --
{ 'tversteeg/registers.nvim',
}, --
{
'tversteeg/registers.nvim',

lazy = false }, --
lazy = false
}, --
{
'phaazon/hop.nvim',
name = 'hop',
Expand All @@ -290,7 +330,7 @@ local M = {
end
}, -- use 'ray-x/lsp_signature.nvim'
{
-- TODO: Am I using it?
-- TODO: Am I using it?
"ahmedkhalf/project.nvim",
enabled = false,
lazy = false,
Expand All @@ -303,7 +343,7 @@ local M = {
end
}, -- use 'jackguo380/vim-lsp-cxx-highlight'
{
-- TODO: Doesn't work
-- TODO: Doesn't work
'simrat39/symbols-outline.nvim',
enabled = false,
keys = { '<leader>;' },
Expand Down Expand Up @@ -341,7 +381,7 @@ local M = {
end
}, --
{
-- xkbswitch TODO: doesn't work
-- xkbswitch TODO: doesn't work
'lyokha/vim-xkbswitch',
lazy = true,
enabled = false,
Expand All @@ -350,7 +390,7 @@ local M = {
vim.g.XkbSwitchIMappings = { 'ru', 'sk(qwerty)', 'ua' }
end
}, --
{ 'folke/neodev.nvim', ft = { 'lua' }, config = true }, {
{ 'folke/neodev.nvim', ft = { 'lua' }, config = true }, {
'luochen1990/rainbow',
lazy = false,
enabled = false,
Expand All @@ -370,17 +410,17 @@ local M = {
},
separately = {
markdown = {
parentheses_options = 'containedin=markdownCode contained' -- "enable rainbow for code blocks only
parentheses_options = 'containedin=markdownCode contained' -- "enable rainbow for code blocks only
},
css = 0, -- disable this plugin for css files
nerdtree = 0 -- rainbow is conflicting with NERDTree, creating extra parentheses
css = 0, -- disable this plugin for css files
nerdtree = 0 -- rainbow is conflicting with NERDTree, creating extra parentheses
}
}
end

}, --
}, --
{
-- bar at the bottom
-- bar at the bottom
"hoob3rt/lualine.nvim",
enabled = false,
lazy = false,
Expand Down
41 changes: 36 additions & 5 deletions Config/nvim/lua/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,38 @@ function DisableSyntaxOnLargeFiles()
end
end



--- @param buf number
--- @param option string
--- @param value any
function SetLocalOption(buf, option, value)
vim.api.nvim_buf_set_option(buf, option, value)
end

--- Creates a new auto command.
--- @param event string | table The event(s) that will trigger the handler (callback or command).
--- @param callback fun(args: table):(boolean|nil) Lua function (or Vimscript function name, if string) called when the event(s) is triggered. Lua callback can return true to delete the autocommand. The table argument of the callback function has these keys:
--- id (number): autocommand id
--- event (string): name of the triggered event autocmd-events
--- group (number|nil): autocommand group id, if any
--- match (string): expanded value of <amatch>
--- buf (number): expanded value of <abuf>
--- file (string): expanded value of <afile>
--- data (any): arbitrary data passed from nvim_exec_autocmds()
--- @param opts table | nil Options dictionary:
--- group string|integer, optional: autocommand group name or id to match against.
--- pattern string|table, optional: pattern(s) to match literally autocmd-pattern.
--- buffer integer, optional: buffer number for buffer-local autocommands autocmd-buflocal. Cannot be used with {pattern}.
--- desc string, optional: description (for documentation and troubleshooting).
function AutoCommand(event, callback, opts)
if opts == nil then
opts = {}
end
opts.callback = callback
vim.api.nvim_create_autocmd(event, opts)
end

--- @param mode string
--- @param key string
--- @param cmd string | function
Expand Down Expand Up @@ -125,8 +157,8 @@ function OnAttach(client, bufnr)
-- completion = { autocomplete = false },
formatting = {
format = lspkind.cmp_format({
mode = 'symbol', -- show only symbol annotations
maxwidth = 30, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
mode = 'symbol', -- show only symbol annotations
maxwidth = 30, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
before = function(_, vim_item) return vim_item end,
symbol_map = { Copilot = "" }
Expand Down Expand Up @@ -279,15 +311,15 @@ function RootPattern(...)
local function strip_archive_subpath(path)
-- Matches regex from zip.vim / tar.vim
path = vim.fn.substitute(path, 'zipfile://\\(.\\{-}\\)::[^\\\\].*$', '\\1',
'')
'')
path = vim.fn.substitute(path, 'tarfile:\\(.\\{-}\\)::.*$', '\\1', '')
return path
end
local patterns = vim.tbl_flatten { ... }
local function matcher(path)
for _, pattern in ipairs(patterns) do
for _, p in ipairs(vim.fn.glob(_path.join(_path.escape_wildcards(path),
pattern), true, true)) do
pattern), true, true)) do
if _path.exists(p) then return path end
end
end
Expand All @@ -296,5 +328,4 @@ function RootPattern(...)
startpath = strip_archive_subpath(startpath)
return search_ancestors(startpath, matcher)
end

end
4 changes: 2 additions & 2 deletions Config/qutebrowser/qsettings/QtProject.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[FileDialog]
history=file:///home/ddystopia/school/aj2, file:///home/ddystopia, file:///home/ddystopia/Documents/resume, file:///home/ddystopia/Downloads, file:///home/ddystopia/Documents/scans
lastVisited=file:///home/ddystopia/Documents/scans
history=file:///home/ddystopia/Downloads, file:///home/ddystopia/Documents/scans, file:///home/ddystopia/Media/wallpapers, file:///home/ddystopia/school/aj2, file:///home/ddystopia/Media/memes, file:///home/ddystopia
lastVisited=file:///home/ddystopia
qtVersion=5.15.9
shortcuts=file:, file:///home/ddystopia
sidebarWidth=97
Expand Down
Loading

0 comments on commit 6d76ef6

Please sign in to comment.