From a70f685038bad6c39522014435e3af808f2280d9 Mon Sep 17 00:00:00 2001 From: Tibeuleu <> Date: Fri, 4 Apr 2025 16:45:21 +0200 Subject: [PATCH 1/2] add element, additionnal qutebrowser setup, cleanup --- .config/i3/config | 2 +- .config/nvim/lua/config/options.lua | 1 - .config/qutebrowser/autoconfig.yml | 4 +++- .config/qutebrowser/config.py | 1 - .config/x11/xprofile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index d339f7e..9e0026f 100755 --- a/.config/i3/config +++ b/.config/i3/config @@ -72,7 +72,7 @@ bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!dropdown_).*$"] exec - bindsym $mod+w exec --no-startup-id $BROWSER bindsym $mod+Shift+w exec $term -e nmtui -#bindsym $mod+r exec --no-startup-id element-desktop +bindsym $mod+r exec --no-startup-id element-desktop bindsym $mod+Shift+r exec --no-startup-id dmenuunicode bindsym $mod+e exec $term -e lf diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua index 5237700..29fbee1 100644 --- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -82,4 +82,3 @@ vim.api.nvim_create_autocmd('TextYankPost', { }) end, }) - diff --git a/.config/qutebrowser/autoconfig.yml b/.config/qutebrowser/autoconfig.yml index cbcc674..995998b 100644 --- a/.config/qutebrowser/autoconfig.yml +++ b/.config/qutebrowser/autoconfig.yml @@ -6,5 +6,7 @@ config_version: 2 settings: + content.javascript.enabled: + global: true statusbar.show: - global: always + global: never diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 263a04b..e124592 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -1176,7 +1176,6 @@ c.url.searchengines = { "!aw": "https://wiki.archlinux.org/index.php/Special:Search?search={}", "!ads": "https://ui.adsabs.harvard.edu/search/q={}", "!sci": "https://sci-hub.se/{}", - "!g": "https://www.google.com/search?hl=en&q={}", "!w": "https://en.wikipedia.org/w/index.php?title=Special%3ASearch&search={}", "!y": "https://www.youtube.com/results?search_query={}&search=Search", } diff --git a/.config/x11/xprofile b/.config/x11/xprofile index 3b1139c..5fd16e3 100755 --- a/.config/x11/xprofile +++ b/.config/x11/xprofile @@ -17,7 +17,7 @@ remaps & # run the remaps script, switching caps/esc and more; check it for mor setbg & # set the background with the `setbg` script mpd & # music player daemon-you might prefer it as a service though dunst & # dunst for notifications -unclutter & # Remove mouse when idle +unclutter & # Remove mouse when idle xcompmgr & # xcompmgr for transparency # setxkbmap fr & # set the keyboard layout to azerty (comment out if set in /etc/X11/xorg.conf.d/00-keyboard.conf) # xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/Xresources & # Uncomment to use Xresources colors/settings on startup From 74a3582909c470c41474276f8b0d8d319e031924 Mon Sep 17 00:00:00 2001 From: Tibeuleu <> Date: Tue, 8 Apr 2025 19:37:55 +0200 Subject: [PATCH 2/2] switch packer for pckr, fix indent-blankline and code folding --- .../nvim/after/plugin/indent-blankline.lua | 2 +- .config/nvim/after/plugin/lsp.lua | 7 +- .config/nvim/after/plugin/treesitter.lua | 42 ++++-------- .config/nvim/lua/config/gruvbox.lua | 2 +- .config/nvim/lua/config/init.lua | 2 +- .../nvim/lua/config/{packer.lua => pckr.lua} | 64 +++++++++++-------- 6 files changed, 57 insertions(+), 62 deletions(-) rename .config/nvim/lua/config/{packer.lua => pckr.lua} (64%) diff --git a/.config/nvim/after/plugin/indent-blankline.lua b/.config/nvim/after/plugin/indent-blankline.lua index 3390094..57f6b3f 100644 --- a/.config/nvim/after/plugin/indent-blankline.lua +++ b/.config/nvim/after/plugin/indent-blankline.lua @@ -4,7 +4,7 @@ require("ibl").setup({ indent = { char = " "}, whitespace = { }, scope = { char = "▎", - highlight = "IndentBlanklineContextChar", + -- highlight = "IndentBlanklineContextChar", show_start = false, show_end = false, include = { node_type = { python = { "if_statement", diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index ce0ec39..b02f164 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -32,6 +32,7 @@ local servers = { pylsp = { plugins = { -- I don't want pylsp linter/formatter + black = { enabled = false, }, autopep8 = { enabled = false, }, flake8 = { enabled = false, }, mccabe = { enabled = false, }, @@ -47,11 +48,13 @@ local servers = { filetypes = { "python" }, init_options = { settings = { - -- configuration = "", -- Custom config for ruff to use + configuration = "~/.local/share/nvim/ruff.toml", -- Custom config for ruff to use exclude = { "__about__.py" }, -- Files to be excluded by ruff checking lineLength = 160, -- Line length to pass to ruff checking and formatting organizeImports = true, - preview = false, -- Whether to enable the preview style linting and formatting. + format = { + preview = false, -- Whether to enable the preview style linting and formatting. + }, lint = { enable = true, -- Enable linting -- select = { "F" }, -- Rules to be enabled by ruff diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua index 0275e1a..1f2d129 100644 --- a/.config/nvim/after/plugin/treesitter.lua +++ b/.config/nvim/after/plugin/treesitter.lua @@ -1,6 +1,6 @@ require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "bash", "c", "cpp", "cuda", "latex", "lua", "markdown", "rust", "vim", "vimdoc" }, + ensure_installed = { "bash", "c", "cpp", "cuda", "latex", "lua", "markdown", "python", "rust", "vim", "vimdoc" }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, @@ -24,33 +24,17 @@ require'nvim-treesitter.configs'.setup { }, } local vim = vim -local opt = vim.opt -local api = vim.api -local M = {} -opt.foldmethod = "expr" -opt.foldexpr = "nvim_treesitter#foldexpr()" - --- function to create a list of commands and convert them to autocommands --------- This function is taken from https://github.com/norcalli/nvim_utils -function M.nvim_create_augroups(definitions) - for group_name, definition in pairs(definitions) do - api.nvim_command('augroup '..group_name) - api.nvim_command('autocmd!') - for _, def in ipairs(definition) do - local command = table.concat(vim.tbl_flatten{'autocmd', def}, ' ') - api.nvim_command(command) +vim.o.foldmethod = 'expr' +-- Default to treesitter folding +vim.o.foldexpr = 'v:lua.vim.treesitter.foldexpr()' +-- Prefer LSP folding if client supports it +vim.api.nvim_create_autocmd('LspAttach', { + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client:supports_method('textDocument/foldingRange') then + local win = vim.api.nvim_get_current_win() + vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()' end - api.nvim_command('augroup END') - end -end - - -local autoCommands = { - -- other autocommands - open_folds = { - {"BufReadPost,FileReadPost", "*", "normal zR"} - } -} - -M.nvim_create_augroups(autoCommands) + end, +}) diff --git a/.config/nvim/lua/config/gruvbox.lua b/.config/nvim/lua/config/gruvbox.lua index 26f96ce..f1c1a32 100644 --- a/.config/nvim/lua/config/gruvbox.lua +++ b/.config/nvim/lua/config/gruvbox.lua @@ -22,4 +22,4 @@ require("gruvbox").setup({ dim_inactive = false, transparent_mode = true, }) -vim.cmd.colorscheme("gruvbox") +vim.cmd("colorscheme gruvbox") diff --git a/.config/nvim/lua/config/init.lua b/.config/nvim/lua/config/init.lua index e3660af..d989097 100644 --- a/.config/nvim/lua/config/init.lua +++ b/.config/nvim/lua/config/init.lua @@ -1,4 +1,4 @@ +require("config.pckr") require("config.remap") require("config.options") require("config.gruvbox") -require("config.packer") diff --git a/.config/nvim/lua/config/packer.lua b/.config/nvim/lua/config/pckr.lua similarity index 64% rename from .config/nvim/lua/config/packer.lua rename to .config/nvim/lua/config/pckr.lua index 9aa70a2..073bd48 100644 --- a/.config/nvim/lua/config/packer.lua +++ b/.config/nvim/lua/config/pckr.lua @@ -1,39 +1,48 @@ -return require('packer').startup(function(use) - -- Packer can manage itself - use 'wbthomason/packer.nvim' +local function bootstrap_pckr() + local pckr_path = vim.fn.stdpath("data") .. "/pckr/pckr.nvim" - use { + if not (vim.uv or vim.loop).fs_stat(pckr_path) then + vim.fn.system({ + 'git', + 'clone', + "--filter=blob:none", + 'https://github.com/lewis6991/pckr.nvim', + pckr_path + }) + end + + vim.opt.rtp:prepend(pckr_path) +end + +bootstrap_pckr() + +require('pckr').add{ + { 'nvim-telescope/telescope.nvim', tag = '0.1.1', -- or branch = '0.1.x', requires = { {'nvim-lua/plenary.nvim'} } - } - use "ellisonleao/gruvbox.nvim" - - use { + }; + "ellisonleao/gruvbox.nvim"; + { 'nvim-treesitter/nvim-treesitter', run = function() local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) ts_update() end, - } - use 'nvim-treesitter/playground' - use { + }; + { 'ThePrimeagen/harpoon', requires = { {'nvim-lua/plenary.nvim'} } - } - use 'mbbill/undotree' - use 'tpope/vim-fugitive' - use 'airblade/vim-gitgutter' - - use 'lukas-reineke/indent-blankline.nvim' - - use 'JoosepAlviste/nvim-ts-context-commentstring' - use 'numToStr/Comment.nvim' - - use 'lervag/vimtex' - - use { + }; + 'mbbill/undotree'; + 'tpope/vim-fugitive'; + 'airblade/vim-gitgutter'; + 'lukas-reineke/indent-blankline.nvim'; + 'JoosepAlviste/nvim-ts-context-commentstring'; + 'numToStr/Comment.nvim'; + 'lervag/vimtex'; + { 'neovim/nvim-lspconfig', requires = { -- LSP Support @@ -57,7 +66,6 @@ return require('packer').startup(function(use) -- Utils {'j-hui/fidget.nvim'}, {'folke/neodev.nvim'} - } - } - -end) + }; + }; +}