diff --git a/foot/.config/foot/foot.ini b/foot/.config/foot/foot.ini index 4393781..ca37017 100644 --- a/foot/.config/foot/foot.ini +++ b/foot/.config/foot/foot.ini @@ -1,4 +1,4 @@ -font=Ttyp0:pixelsize=13 +font=Hack Nerd Font Mono:pixelsize=14 #font=JuliaMono:pixelsize=12 [cursor] diff --git a/git/.config/git/config b/git/.config/git/config index 2c9990e..1271a4c 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -4,7 +4,7 @@ signingkey = DD0998E6CDF294537FC604F991FA5E5BF9AA901C [color] ui = auto -[merege] +[merge] conflictstyle = diff3 [commit] gpgsign = false diff --git a/nvim.lua/.config/nvim/.gitignore b/nvim.lua/.config/nvim/.gitignore new file mode 100644 index 0000000..8cb205e --- /dev/null +++ b/nvim.lua/.config/nvim/.gitignore @@ -0,0 +1 @@ +plugin diff --git a/nvim.lua/.config/nvim/init.lua b/nvim.lua/.config/nvim/init.lua new file mode 100644 index 0000000..396baa7 --- /dev/null +++ b/nvim.lua/.config/nvim/init.lua @@ -0,0 +1,83 @@ +-- set leader and locleader before setting any maps +vim.g.mapleader = ' ' +vim.g.maplocalleader = '\\' + +-- set up packer and all the plugins +require('plugins') + +-- old config still to luaify +vim.cmd([[ +" filetype magic +autocmd BufRead,BufNewFile *.nasm set filetype=nasm + +" langmap russian +set langmap=ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz + +" Incrementally show effects of :s, :smagic, :snomagic +set icm=split + +set number + +set nobackup nowritebackup +set noswapfile + +" autosmartident +set ai +set si +set tabstop=4 +set shiftwidth=4 +set softtabstop=4 +set expandtab + +" arrows for visual line navigation +imap gk +imap gj +nmap gk +nmap gj +vmap gk +vmap gj + +set history=999 +set undolevels=999 + +" Copy to clipboard +vnoremap y "+y +nnoremap Y "+yg_ +nnoremap y "+y +nnoremap yy "+yy +" Paste from clipboard +nnoremap p "+p +nnoremap P "+P +vnoremap p "+p +vnoremap P "+P + +"set updatetime=107 + +" disable modelines +set nomodeline + +" change tab completion to more bash-like +set wildmode=longest:full,list:full + +" U is quite useless +nnoremap U :echo "NOPE!" + +" help is quite annoying when you miss esc +map +imap + +" do not conceal stuff +set conceallevel=0 +set foldlevel=999 + +" Whitespace highlight +highlight RedundantSpaces ctermbg=red guibg=red +match RedundantSpaces /\s\+\%#\@'] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Insert, + select = false, + }) + }), + + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'snippy' }, -- For snippy users. + { name = 'buffer' }, + { name = 'path' }, + { name = 'nvim_lua' }, + }), + + formatting = { + format = function(entry, vim_item) + vim_item.kind = string.format('%s', vim_item.kind) + vim_item.menu = ({ + nvim_lsp = '[LSP]', + buffer = '[B]', + path = '[F]', + snippy = '[S]', + nvim_lua = '[vim]', + })[entry.source.name] + + return vim_item + end, + } +}) diff --git a/nvim.lua/.config/nvim/lua/lsp_setup.lua b/nvim.lua/.config/nvim/lua/lsp_setup.lua new file mode 100644 index 0000000..37f3c71 --- /dev/null +++ b/nvim.lua/.config/nvim/lua/lsp_setup.lua @@ -0,0 +1,90 @@ +local nvim_lsp = require'lspconfig' +local cmp_lsp = require'cmp_nvim_lsp' + +-- General LSP config +-- Limit capabilities to advertised by cmp +local capabilities = cmp_lsp.default_capabilities() + +-- default lsp config +-- Mappings. +-- See `:help vim.diagnostic.*` for documentation on any of the below functions +local opts = { noremap=true, silent=true } +vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) + +-- Use an on_attach function to only map the following keys +-- after the language server attaches to the current buffer +local on_attach = function(client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local bufopts = { noremap=true, silent=true, buffer=bufnr } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, bufopts) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) + vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) + vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) +end + +local lsp_flags = { + -- This is the default in Nvim 0.7+ + debounce_text_changes = 150, +} +-- always show sign column +vim.cmd([[set signcolumn=yes]]) + +vim.g.moonflyNormalFloat = true +vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = "single" + } +) +vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with( + vim.lsp.handlers.signatureHelp, { + border = "single" + } +) +vim.diagnostic.config({ float = { border = "single" } }) + +-- Setting up servers per language +-- Default nvim-lsp setup: nil, clangd +local servers = { 'nil_ls', 'clangd', 'texlab' } + +for _, serv in ipairs(servers) do + nvim_lsp[serv].setup{ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, + } +end + +-- Rust: using rust tools package +local rt = require("rust-tools") +rt.setup({ + server = { + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, + settings = { + ["rust-analyzer"] = { + cargo = { + allFeatures = true, + }, + }, + }, + }, +}) diff --git a/nvim.lua/.config/nvim/lua/lualine_setup.lua b/nvim.lua/.config/nvim/lua/lualine_setup.lua new file mode 100644 index 0000000..62dd119 --- /dev/null +++ b/nvim.lua/.config/nvim/lua/lualine_setup.lua @@ -0,0 +1,11 @@ +-- this now handled by the lualine +vim.cmd([[set noshowmode]]) + +return require('lualine').setup { + options = { + icons_enabled = true, + --theme = 'everforest', + -- section_separators = '', + -- component_seaparators = '', + } +} diff --git a/nvim.lua/.config/nvim/lua/plugins.lua b/nvim.lua/.config/nvim/lua/plugins.lua new file mode 100644 index 0000000..75576e0 --- /dev/null +++ b/nvim.lua/.config/nvim/lua/plugins.lua @@ -0,0 +1,214 @@ +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] + return true + end + return false +end + +local setup_fzf = function() + vim.api.nvim_set_keymap('n', '', "lua require('fzf-lua').files()", { noremap = true, silent = true }) + vim.api.nvim_set_keymap('n', 'g', "lua require('fzf-lua').git_files()", { noremap = true, silent = true }) + vim.api.nvim_set_keymap('n', 'b', "lua require('fzf-lua').buffers()", { noremap = true, silent = true }) +end + +local packer_bootstrap = ensure_packer() + +return require('packer').startup(function(use) + use 'wbthomason/packer.nvim' + + -- insert images into markdown automagically + use { + 'ferrine/md-img-paste.vim', + ft = { 'markdown' }, + config = vim.cmd([[ + " insert images into markdown automagically + autocmd FileType markdown nmap p :call mdip#MarkdownClipboardImage() + let g:mdip_imgdir = 'static' + let g:mdip_imgname = 'image' + ]]) + } + + --Better syntax + use 'rust-lang/rust.vim' + use 'LnL7/vim-nix' + use 'cespare/vim-toml' + use 'JuliaEditorSupport/julia-vim' + use { + 'lervag/vimtex', + ft = { 'tex' }, + -- do not conceal stuff + config = function() vim.cmd([[ + let g:tex_conceal = '' + autocmd FileType tex nnoremap = :VimtexTocToggle + ]]) end, + } + use 'lepture/vim-jinja' + use 'neomutt/neomutt.vim' + use 'godlygeek/tabular' + use 'preservim/vim-markdown' + -- treesitter + use { + 'nvim-treesitter/nvim-treesitter', + run = function() + local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) + ts_update() + end, + config = function() + require('ts_setup') + end, + } + + -- pretty bits + -- use { + -- '/home/grue/projects/zen-footburn.nvim', + -- config = function() + -- vim.cmd([[ + -- set termguicolors + -- colorscheme zenburn + -- ]]) + -- end, + -- } + use { + 'sainnhe/everforest', + config = function() + vim.cmd([[ + set termguicolors + let g:everforest_transparent_background = 2 + colorscheme everforest + ]]) + end, + } + -- use { + -- 'jeffkreeftmeijer/vim-dim', + -- config = function() + -- vim.cmd([[ + -- colorscheme dim + -- ]]) + -- end, + -- } + use { + 'johnfrankmorgan/whitespace.nvim', + config = function () + require('whitespace-nvim').setup({ + ignored_filetypes = { 'TelescopePrompt', 'Trouble', 'help' }, + }) + + -- remove trailing whitespace with a keybinding + vim.keymap.set('n', 't', require('whitespace-nvim').trim) + end + } + use { + 'nvim-lualine/lualine.nvim', + requires = { 'kyazdani42/nvim-web-devicons', opt = true }, + -- after = { 'zen-footburn.nvim' }, + config = function() + -- this now handled by the lualine + vim.cmd([[set noshowmode]]) + + return require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + -- section_separators = '', + -- component_seaparators = '', + } + } + end, + } + + -- Git + use 'tpope/vim-fugitive' + use { + 'lewis6991/gitsigns.nvim', + config = function() + vim.cmd([[set signcolumn=yes]]) + require('gitsigns').setup() + end, + } + + -- Nifty stuff + use 'tpope/vim-surround' + -- use 'airblade/vim-rooter' + use { + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + requires = { { 'nvim-lua/plenary.nvim' } }, + config = function() + require('telescope').setup{ + pickers = { + find_files = { + theme = "dropdown", + } + } + } + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'ff', builtin.find_files, {}) + vim.keymap.set('n', 'fg', builtin.live_grep, {}) + vim.keymap.set('n', 'b', builtin.buffers, {}) + vim.keymap.set('n', 'fh', builtin.help_tags, {}) + end, + } + + + -- completion + use { + 'hrsh7th/nvim-cmp', + requires = { + -- completion sources + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-nvim-lua', + 'dcampos/nvim-snippy', + 'dcampos/cmp-snippy' + }, + config = function() + require('completion') + end, + } + + use { + 'dcampos/nvim-snippy', + config = function() + require'snippy'.setup({ + mappings = { + is = { + [''] = 'expand_or_advance', + [''] = 'previous', + }, + nx = { + ['x'] = 'cut_text', + }, + }, + }) + end, + } + use 'dcampos/cmp-snippy' + use 'honza/vim-snippets' + + -- neovim VSCode edition + use { + 'neovim/nvim-lspconfig', + after = { 'nvim-cmp' }, + requires = { 'simrat39/rust-tools.nvim' }, + config = function() + require'lsp_setup' + end, + } + + use { + 'jamessan/vim-gnupg', + } + + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if packer_bootstrap then + require('packer').sync() + end +end) + + diff --git a/nvim.lua/.config/nvim/lua/ts_setup.lua b/nvim.lua/.config/nvim/lua/ts_setup.lua new file mode 100644 index 0000000..d01e237 --- /dev/null +++ b/nvim.lua/.config/nvim/lua/ts_setup.lua @@ -0,0 +1,17 @@ +local ts_conf = require('nvim-treesitter.configs') + +ts_conf.setup { + ensure_installed = { "vim", "vimdoc", "rust", "nix" }, + highlight = { + enable = true, + }, + indent = { + enable = true, + }, + incremental_selection = { + enable = true, + }, + textobjects = { + enable = true, + }, +} diff --git a/sway/.config/alacritty/alacritty.toml b/sway/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..a2d7102 --- /dev/null +++ b/sway/.config/alacritty/alacritty.toml @@ -0,0 +1,43 @@ +[colors.cursor] +text = "#000000" +cursor = "#ffff00" + +[colors.primary] +foreground = "#dcdccc" +background = "#111111" + +[colors.normal] +black = "#222222" +red = "#cc9393" +green = "#7f9f7f" +yellow = "#d0bf8f" +blue = "#6ca0a3" +magenta = "#dc8cc3" +cyan = "#93e0e3" +white = "#dcdccc" + +[colors.bright] +black = "#666666" +red = "#dca3a3" +green = "#bfebbf" +yellow = "#f0dfaf" +blue = "#8cd0d3" +magenta = "#fcace3" +cyan = "#b3ffff" +white = "#ffffff" + + +[font] +size = 10 + +[font.bold] +family = "Hack Nerd Font Mono" + +[font.bold_italic] +family = "Hack Nerd Font Mono" + +[font.italic] +family = "Hack Nerd Font Mono" + +[font.normal] +family = "Hack Nerd Font Mono" diff --git a/sway/.config/i3status-rust/config.toml b/sway/.config/i3status-rust/config.toml index 3f34414..5a4c59c 100644 --- a/sway/.config/i3status-rust/config.toml +++ b/sway/.config/i3status-rust/config.toml @@ -2,7 +2,7 @@ theme = "foot" [icons] -icons = "awesome6" +icons = "material-nf" [[block]] block = "time" @@ -14,23 +14,23 @@ idle_fg = { link = "idle_bg" } [[block]] block = "maildir" interval = 60 -inboxes = ["/home/grue/mail/dump@dvb.solutions/INBOX", "/home/grue/mail/grigory@tlm.solutions/INBOX" ] +inboxes = ["/home/0xa/mail/dump@dvb.solutions/INBOX", "/home/0xa/mail/grigory@tlm.solutions/INBOX" ] threshold_critical = 1 display_type = "new" [[block.click]] button = "left" -cmd = "foot --app-id floating-foot --window-size-chars=150x50 -- zsh -c neomutt" +cmd = "alacritty --class floating-foot -e zsh -c neomutt" [[block]] block = "maildir" interval = 60 -inboxes = ["/home/grue/mail/mail@oxapentane.com/INBOX", "/home/grue/mail/mail@oxapentane.com/sinkhole", "/home/grue/mail/grigory@shipunov.xyz/INBOX"] +inboxes = ["/home/0xa/mail/mail@oxapentane.com/INBOX", "/home/0xa/mail/mail@oxapentane.com/sinkhole", "/home/0xa/mail/grigory@shipunov.xyz/INBOX"] threshold_warning = 1 threshold_critical = 10 display_type = "new" [[block.click]] button = "left" -cmd = "foot --app-id floating-foot --window-size-chars=150x50 -- zsh -c neomutt" +cmd = "alacritty --class floating-foot -e zsh -c neomutt" [[block]] block = "backlight" @@ -49,20 +49,16 @@ block = "net" device = "enp1s0f0" format = " $icon{ | $ip $ipv6 }" -## TODO patch upstream -# [[block]] -# block = "net" -# device = "wg-mullvad" -# format = " $device " +# TODO patch upstream +#[[block]] +#block = "net" +#device = "wg-mullvad" +#format = " $device up $ip " [[block]] block = "memory" format = " $icon $mem_used_percents " -[[block]] -block = "cpu" -format = " $icon $frequency $barchart $utilization " - [[block]] block = "load" format = " $1m.eng(w:4) $5m.eng(w:4) $15m.eng(w:4) " diff --git a/sway/.config/kanshi/config b/sway/.config/kanshi/config index ecb76b8..b43586a 100644 --- a/sway/.config/kanshi/config +++ b/sway/.config/kanshi/config @@ -1,14 +1,14 @@ # Default profile { - output eDP-1 enable + output eDP-1 enable adaptive_sync on } # Home profile { - output eDP-1 enable enable position -1920,960 - output "LG Electronics LG HDR 4K 0x00000CA7" enable mode 3840x2160 position 0,0 + output eDP-1 enable position 3840,0 adaptive_sync on + output DP-8 enable mode 3840x2160 position 0,0 adaptive_sync on } # Work profile { - output eDP-1 enable position 0,1200 - output "Samsung Electric Company LF24T450G HNMTA01726" enable mode 1920x1200 position 0,0 + output eDP-1 enable position 0,1200 adaptive_sync on + output "Samsung Electric Company LF24T450G HNMTA01726" enable mode 1920x1200@60Hz position 0,0 adaptive_sync on } diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 4fcaea1..644b52e 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -14,8 +14,8 @@ set $down j set $up k set $right l # Your preferred terminal emulator -set $term foot -set $floatterm foot --app-id floating-foot +set $term alacritty +set $floatterm alacritty --class floating-foot set $lock $HOME/.config/sway/lock.sh # Your preferred application launcher @@ -27,9 +27,9 @@ set $menu rofi -show combi | xargs swaymsg exec -- # # Default wallpaper (more resolutions are available in /run/current-system/sw/share/backgrounds/sway/) # output * bg /run/current-system/sw/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill -# output * bg /home/grue/Pictures/tiles/23.png tile +output * bg /home/0xa/Pictures/tiles/23.png tile # output * bg /home/grue/Pictures/paper.jpg fill -output * bg ./wall.jpg fill +# output * bg ./wall.jpg fill # # Example configuration: @@ -61,6 +61,7 @@ exec swayidle -w \ dwt enabled dwtp enabled middle_emulation enabled + natural_scroll enabled } input type:keyboard { @@ -86,7 +87,7 @@ seat * hide_cursor 5000 for_window [app_id="floating-foot"] floating enable # Start a python shell - bindsym --to-code $mod+z exec $floatterm python + bindsym --to-code $mod+z exec $floatterm -e python # Kill focused window bindsym --to-code $mod+Shift+q kill @@ -111,9 +112,9 @@ seat * hide_cursor 5000 bindsym --to-code --locked XF86MonBrightnessDown exec "brightnessctl set 5%-" bindsym --to-code --locked XF86MonBrightnessUp exec "brightnessctl set +5%" # Volume - bindsym --to-code --locked XF86AudioRaiseVolume exec 'pamixer -i 1' - bindsym --to-code --locked XF86AudioLowerVolume exec 'pamixer -d 1' - bindsym --to-code --locked XF86AudioMute exec 'pamixer -t' + bindsym --to-code --locked XF86AudioRaiseVolume exec 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+' + bindsym --to-code --locked XF86AudioLowerVolume exec 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-' + bindsym --to-code --locked XF86AudioMute exec 'wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle' # Screen locking bindsym --to-code $mod+Delete exec $lock # Screenshots @@ -308,7 +309,7 @@ client.focused $color06 $color06 $color00 $color07 $color06 # Read `man 5 sway-bar` for more information about this section. bar { position top - font pango:Ttyp0 8 + font pango:Hack 9 icon_theme "Adwaita" status_command /run/current-system/sw/bin/i3status-rs colors { @@ -324,7 +325,7 @@ bar { # default border default_border pixel 2 # Set font -font pango:Ttyp0 8 +font pango:Hack 9 # bindsym --to-code $mod+t input type:touchpad toggle diff --git a/sway/.config/sway/lock.sh b/sway/.config/sway/lock.sh index a725eb6..8edb9b9 100755 --- a/sway/.config/sway/lock.sh +++ b/sway/.config/sway/lock.sh @@ -1,13 +1,3 @@ #!/usr/bin/env bash -img="$HOME/Pictures/paper.jpg" - -#grim $img -#gm convert $img -scale 5% -scale 2000% $img -#gm convert $img -blur 0x10 $img -# swaylock -Ffk -i $img -s fill -# swaylock -Ffk -i $HOME/Pictures/tiles/156.png -s tile swaylock -Ffk -i $HOME/Pictures/tiles/23.png -s tile -# swaylock -Ffk -i $HOME/Pictures/tiles/10.png -s tile - -#rm -f $img