From c6e4bab50f5e210c4e157f5ece34fc6ac4ddbc48 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 9 May 2023 10:03:47 -0500 Subject: [PATCH] Before sway->hyprland --- common/bin/dotfiles-setup | 2 - common/elixir/iex.exs | 1 + common/neovim/.gitignore | 8 - common/neovim/colors/base16-donokai.vim | 1 - common/neovim/colors/donokai.vim | 141 ------ common/neovim/init.lua | 583 ------------------------ common/wezterm/.gitkeep | 0 os/linux/dotfiles-setup.d.fish | 1 + os/linux/hypr/hyprland.conf | 163 +++++++ 9 files changed, 165 insertions(+), 735 deletions(-) delete mode 100644 common/neovim/.gitignore delete mode 120000 common/neovim/colors/base16-donokai.vim delete mode 100644 common/neovim/colors/donokai.vim delete mode 100644 common/neovim/init.lua create mode 100644 common/wezterm/.gitkeep create mode 100644 os/linux/hypr/hyprland.conf diff --git a/common/bin/dotfiles-setup b/common/bin/dotfiles-setup index 9550237..c143d23 100755 --- a/common/bin/dotfiles-setup +++ b/common/bin/dotfiles-setup @@ -42,9 +42,7 @@ test -d ~/.tmux/pluginx/tpm || \ l common/zellij $c/zellij l common/fish $c/fish l common/bash/rc $h/.bashrc -l common/neovim $c/nvim l common/wezterm $c/wezterm -l common/colors/vim $c/nvim/colors/base16-donokai.vim l common/weechat $h/.weechat l common/scim/rc $h/.scimrc l common/scim/lua $h/.scim/lua diff --git a/common/elixir/iex.exs b/common/elixir/iex.exs index df6c461..9f6eb7e 100644 --- a/common/elixir/iex.exs +++ b/common/elixir/iex.exs @@ -6,6 +6,7 @@ IEx.configure( colors: [enabled: true], inspect: [ pretty: true, + printable_limit: :infinity, limit: :infinity ], default_prompt: diff --git a/common/neovim/.gitignore b/common/neovim/.gitignore deleted file mode 100644 index 8058520..0000000 --- a/common/neovim/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/* -!/.gitignore -!/init.vim -!/init.lua -!/ftplugin -!/lua -!/coc-settings.json -!/colors diff --git a/common/neovim/colors/base16-donokai.vim b/common/neovim/colors/base16-donokai.vim deleted file mode 120000 index 3af3c64..0000000 --- a/common/neovim/colors/base16-donokai.vim +++ /dev/null @@ -1 +0,0 @@ -/home/daniel/.home/.config/lytedev-dotfiles/common/colors/vim \ No newline at end of file diff --git a/common/neovim/colors/donokai.vim b/common/neovim/colors/donokai.vim deleted file mode 100644 index 51f026d..0000000 --- a/common/neovim/colors/donokai.vim +++ /dev/null @@ -1,141 +0,0 @@ -hi clear -syntax reset - -hi normal cterm=none ctermfg=7 -hi bold cterm=bold - -hi statusline cterm=none ctermfg=7 ctermbg=234 -hi statuslinenc cterm=none ctermfg=234 ctermbg=0 -hi inactivebuffer cterm=none ctermbg=234 ctermfg=7 -hi activebuffer cterm=none ctermfg=0 ctermbg=4 -hi dirtybuffer cterm=none ctermfg=0 ctermbg=1 -hi activedirtybuffer cterm=none ctermfg=0 ctermbg=3 -hi pmenu cterm=none ctermfg=7 ctermbg=236 -hi pmenusel cterm=none ctermbg=4 ctermfg=0 -hi pmenusbar cterm=none ctermbg=236 ctermfg=240 -hi pmenuthumb cterm=none ctermbg=240 ctermfg=240 -hi linenr cterm=none ctermfg=240 -hi indentblanklinechar cterm=none ctermfg=236 -hi signcolumn cterm=none ctermfg=234 ctermbg=0 -hi matchparen cterm=none ctermbg=5 ctermfg=0 -hi search cterm=bold ctermbg=4 -hi incsearch cterm=bold ctermbg=4 - -hi todo cterm=none ctermfg=7 ctermbg=240 -hi comment cterm=none ctermfg=240 -hi keyword cterm=none ctermfg=7 -hi operator cterm=none ctermfg=7 -hi repeat cterm=none ctermfg=1 -hi type cterm=none ctermfg=3 -hi string cterm=none ctermfg=2 -hi noise cterm=none ctermfg=5 ctermbg=0 -hi statement cterm=none ctermfg=1 ctermbg=0 -hi conditional cterm=none ctermfg=1 ctermbg=0 -hi structure cterm=none ctermfg=4 ctermbg=0 -hi special cterm=none ctermfg=5 ctermbg=0 -hi preproc cterm=none ctermfg=1 ctermbg=0 -hi identifier cterm=none ctermfg=4 ctermbg=0 -hi constant cterm=none ctermfg=1 -hi nontext ctermfg=0 ctermbg=0 -hi diffoldfile cterm=none ctermfg=1 -hi diffremoved cterm=none ctermfg=1 -hi diffadded cterm=none ctermfg=2 - -" TODO: diagnostics popups, telescope dialogs - -hi LspDiagnosticsSignWarning cterm=none ctermfg=1 ctermbg=0 -hi lspdiagnosticsvirtualtextwarning cterm=none ctermfg=1 ctermbg=0 - -hi TelescopeBorder ctermfg=234 -hi TelescopePromptBorder ctermfg=234 -hi TelescopeResultsBorder ctermfg=234 -hi TelescopePreviewBorder ctermfg=234 - -hi TelescopeSelection ctermbg=236 ctermfg=7 -hi TelescopeSelectionCaret ctermfg=7 -hi TelescopeMultiSelection ctermfg=7 -hi TelescopeNormal ctermfg=7 - -hi TelescopeMatching ctermfg=0 ctermbg=4 -hi TelescopePromptPrefix guifg=red - -" vim tui elements -" call hi('Debug', s:gui08, '', s:cterm08, '', '', '') -" call hi('Directory', s:gui0D, '', s:cterm0D, '', '', '') -" call hi('Error', s:gui00, s:gui08, s:cterm00, s:cterm08, '', '') -" call hi('ErrorMsg', s:gui08, s:gui00, s:cterm08, s:cterm00, '', '') -" call hi('Exception', s:gui08, '', s:cterm08, '', '', '') -" call hi('FoldColumn', s:gui0C, s:gui01, s:cterm0C, s:cterm01, '', '') -" call hi('Folded', s:gui03, s:gui01, s:cterm03, s:cterm01, '', '') -" call hi('IncSearch', s:gui01, s:gui09, s:cterm01, s:cterm09, 'none', '') -" call hi('Italic', '', '', '', '', 'none', '') -" call hi('Macro', s:gui08, '', s:cterm08, '', '', '') -" call hi('MatchParen', s:gui00, s:gui03, s:cterm00, s:cterm03, '', '') -" call hi('ModeMsg', s:gui0B, '', s:cterm0B, '', '', '') -" call hi('MoreMsg', s:gui0B, '', s:cterm0B, '', '', '') -" call hi('Question', s:gui0D, '', s:cterm0D, '', '', '') -" call hi('Search', s:gui03, s:gui0A, s:cterm03, s:cterm0A, '', '') -" call hi('SpecialKey', s:gui03, '', s:cterm03, '', '', '') -" call hi('TooLong', s:gui08, '', s:cterm08, '', '', '') -" call hi('Underlined', s:gui08, '', s:cterm08, '', '', '') -" call hi('Visual', '', s:gui02, '', s:cterm02, '', '') -" call hi('VisualNOS', s:gui08, '', s:cterm08, '', '', '') -" call hi('WarningMsg', s:gui08, '', s:cterm08, '', '', '') -" call hi('WildMenu', s:gui08, s:gui0A, s:cterm08, '', '', '') -" call hi('Title', s:gui0D, '', s:cterm0D, '', 'none', '') -" call hi('Conceal', s:gui0D, s:gui00, s:cterm0D, s:cterm00, '', '') -" call hi('Cursor', s:gui00, s:gui05, s:cterm00, s:cterm05, '', '') -" call hi('NonText', s:gui03, '', s:cterm03, '', '', '') -" call hi('Normal', s:gui05, s:gui00, s:cterm05, s:cterm00, '', '') -" call hi('VertSplit', s:gui02, s:gui02, s:cterm02, s:cterm02, 'none', '') -" call hi('ColorColumn', '', s:gui01, '', s:cterm01, 'none', '') -" call hi('CursorColumn', '', s:gui01, '', s:cterm01, 'none', '') -" call hi('CursorLine', '', s:gui01, '', s:cterm01, 'none', '') -" call hi('CursorLineNr', s:gui03, s:gui01, s:cterm03, s:cterm01, '', '') -" call hi('PMenu', s:gui04, s:gui01, s:cterm04, s:cterm01, 'none', '') -" call hi('PMenuSel', s:gui01, s:gui04, s:cterm01, s:cterm04, '', '') -" call hi('TabLine', s:gui03, s:gui01, s:cterm03, s:cterm01, 'none', '') -" call hi('TabLineFill', s:gui03, s:gui01, s:cterm03, s:cterm01, 'none', '') -" call hi('TabLineSel', s:gui0B, s:gui01, s:cterm0B, s:cterm01, 'none', '') - -" standard syntax -" call hi('Boolean', s:gui09, '', s:cterm09, '', '', '') -" call hi('Character', s:gui08, '', s:cterm08, '', '', '') -" call hi('Comment', s:gui03, '', s:cterm03, '', '', '') -" call hi('Conditional', s:gui0E, '', s:cterm0E, '', '', '') -" call hi('Constant', s:gui09, '', s:cterm09, '', '', '') -" call hi('Define', s:gui0E, '', s:cterm0E, '', 'none', '') -" call hi('Delimiter', s:gui0F, '', s:cterm0F, '', '', '') -" call hi('Float', s:gui09, '', s:cterm09, '', '', '') -" call hi('Function', s:gui0D, '', s:cterm0D, '', '', '') -" call hi('Identifier', s:gui08, '', s:cterm08, '', 'none', '') -" call hi('Include', s:gui0D, '', s:cterm0D, '', '', '') -" call hi('Keyword', s:gui0E, '', s:cterm0E, '', '', '') -" call hi('Label', s:gui0A, '', s:cterm0A, '', '', '') -" call hi('Number', s:gui09, '', s:cterm09, '', '', '') -" call hi('Operator', s:gui05, '', s:cterm05, '', 'none', '') -" call hi('PreProc', s:gui0A, '', s:cterm0A, '', '', '') -" call hi('Repeat', s:gui0A, '', s:cterm0A, '', '', '') -" call hi('Special', s:gui0C, '', s:cterm0C, '', '', '') -" call hi('SpecialChar', s:gui0F, '', s:cterm0F, '', '', '') -" call hi('Statement', s:gui08, '', s:cterm08, '', '', '') -" call hi('StorageClass', s:gui0A, '', s:cterm0A, '', '', '') -" call hi('String', s:gui0B, '', s:cterm0B, '', '', '') -" call hi('Structure', s:gui0E, '', s:cterm0E, '', '', '') -" call hi('Tag', s:gui0A, '', s:cterm0A, '', '', '') -" call hi('Todo', s:gui0A, s:gui01, s:cterm0A, s:cterm01, '', '') -" call hi('Type', s:gui0A, '', s:cterm0A, '', 'none', '') -" call hi('Typedef', s:gui0A, '', s:cterm0A, '', '', '') -" call hi('DiffAdd', s:gui0B, s:gui01, s:cterm0B, s:cterm01, '', '') -" call hi('DiffChange', s:gui03, s:gui01, s:cterm03, s:cterm01, '', '') -" call hi('DiffDelete', s:gui08, s:gui01, s:cterm08, s:cterm01, '', '') -" call hi('DiffText', s:gui0D, s:gui01, s:cterm0D, s:cterm01, '', '') -" call hi('DiffAdded', s:gui0B, s:gui00, s:cterm0B, s:cterm00, '', '') -" call hi('DiffFile', s:gui08, s:gui00, s:cterm08, s:cterm00, '', '') -" call hi('DiffNewFile', s:gui0B, s:gui00, s:cterm0B, s:cterm00, '', '') -" call hi('DiffLine', s:gui0D, s:gui00, s:cterm0D, s:cterm00, '', '') -" call hi('DiffRemoved', s:gui08, s:gui00, s:cterm08, s:cterm00, '', '') -" call hi('SpellBad', '', s:gui00, '', s:cterm00, 'undercurl', s:gui08) -" call hi('SpellLocal', '', s:gui00, '', s:cterm00, 'undercurl', s:gui0C) -" call hi('SpellCap', '', s:gui00, '', s:cterm00, 'undercurl', s:gui0D) -" call hi('SpellRare', '', s:gui00, '', s:cterm00, 'undercurl', s:gui0E) diff --git a/common/neovim/init.lua b/common/neovim/init.lua deleted file mode 100644 index 8767120..0000000 --- a/common/neovim/init.lua +++ /dev/null @@ -1,583 +0,0 @@ -vim.g.vimdir = os.getenv('XDG_CONFIG_HOME') .. '/nvim' - --- ensure our plugin manager plugin is installed -local packer_install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim' -if #vim.fn.glob(packer_install_path) == 0 then - vim.fn.system { 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', packer_install_path } - vim.cmd 'packadd packer.nvim' -end - -local has_words_before = function() - local line, col = vim.api.nvim_win_get_cursor(0) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil -end - -local packer = require 'packer' - -packer.startup(function() - local plugins = { - 'wbthomason/packer.nvim', -- neovim plugin manager - - 'vim-scripts/LargeFile', -- degrade gracefully with large files - 'tpope/vim-repeat', -- enable repeat for plugin maps - 'tpope/vim-sleuth', -- use whatever whitespace is in the file - 'editorconfig/editorconfig-vim', -- handle .editorconfig files - 'christoomey/vim-tmux-navigator', -- navigate vim splits and tmux panes fluidly - 'machakann/vim-sandwich', -- edit surrounding characters - 'michaeljsmith/vim-indent-object', -- adds indent-level text objects - -- 'wellle/targets.vim', -- add many other text objects - 'bkad/CamelCaseMotion', -- invaluable motions for properly operating on various casings - - { - -- session management - 'olimorris/persisted.nvim', - config = function() - local should_autoload = #vim.v.argv == 1 - require 'persisted'.setup { - autoload = should_autoload, - autosave = should_autoload, - } - end - }, - { - -- toggle comments - 'terrortylor/nvim-comment', - config = function() - require 'nvim_comment'.setup() - end - }, - { - -- fuzzy finder - 'nvim-telescope/telescope.nvim', - requires = { - 'nvim-lua/popup.nvim', - 'nvim-lua/plenary.nvim', - } - }, - { - 'nvim-telescope/telescope-fzf-native.nvim', - run = 'make', - }, - { - 'tzachar/cmp-fuzzy-path', - requires = { 'hrsh7th/nvim-cmp', 'tzachar/fuzzy.nvim' }, - }, - - -- TODO: add keymap ig for toggling these - 'lukas-reineke/indent-blankline.nvim', -- indentation guide lines - 'L3MON4D3/LuaSnip', - - { - -- completion engine - 'hrsh7th/nvim-cmp', - config = function() - local cmp = require 'cmp' - local luasnip = require 'luasnip' - - local prev_item = function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end - - local next_item = function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end - - cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - window = { - }, - mapping = { - [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), - [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), - [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), - -- [''] = cmp.config.n - [''] = cmp.mapping { - i = cmp.mapping.close, - c = cmp.mapping.close, - }, - [''] = cmp.mapping.confirm { select = false }, - -- [""] = cmp.mapping(next_item, { "i", "s" }), - -- [""] = cmp.mapping(prev_item, { "i", "s" }), - [''] = cmp.mapping(next_item, { "i", "s" }), - [''] = cmp.mapping(prev_item, { "i", "s" }), - }, - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'nvim_lsp_signature_help' }, - { name = 'luasnip' }, - }, { - { name = 'buffer' }, - { name = 'path' }, - { name = 'fuzzy_path' }, - }), - formatting = { - format = require("lspkind").cmp_format { - with_text = true, - menu = { - nvim_lsp = "[LSP]", - }, - } - }, - } - - cmp.setup.cmdline('/', { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' }, - { name = 'fuzzy_path' }, - } - }) - - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) - }) - end, - }, - 'neovim/nvim-lspconfig', -- language server configuration helper - 'williamboman/nvim-lsp-installer', -- plugin containing installation commands for many language servers - 'hrsh7th/cmp-nvim-lsp-signature-help', - 'hrsh7th/cmp-nvim-lsp', -- add lsp to completion engine - 'hrsh7th/cmp-buffer', -- add buffer information to completion engine - 'hrsh7th/cmp-path', -- add filesystem information to complete enging - 'hrsh7th/cmp-cmdline', -- add completion for vim commands - 'onsails/lspkind-nvim', - 'simrat39/symbols-outline.nvim', - 'saadparwaiz1/cmp_luasnip', - -- TODO: automate this installation process of :COQdeps:COQnow - -- {'ms-jpq/coq_nvim', branch = 'coq'}, - -- {'ms-jpq/coq.thirdparty', branch = '3p'}, - { - -- syntax highlighting and indentation - 'nvim-treesitter/nvim-treesitter', - run = ':TSUpdate', - config = function() - require 'nvim-treesitter.configs'.setup { - ensure_installed = "all", - sync_install = false, - ignore_install = { "phpdoc" }, - indent = { - enable = true, - }, - highlight = { - enable = true, - disable = {}, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - -- additional_vim_regex_highlighting = false, - }, - } - end - }, - 'lukas-reineke/lsp-format.nvim', - } - for _, plugin in pairs(plugins) do packer.use(plugin) end -end) - -local globals = { - mapleader = ' ', - maplocalleader = ' ', - -- skipview_files = { 'COMMIT_EDITMSG' }, - indent_blankline_char = '▏', - indent_blankline_filetype_exclude = { 'help', 'packer' }, - indent_blankline_buftype_exclude = { 'terminal', 'nofile' }, - indent_blankline_char_highlight = 'LineNr', -} -for k, v in pairs(globals) do vim.g[k] = v end - -local options = { - clipboard = 'unnamedplus', - inccommand = 'nosplit', - tabstop = 2, - softtabstop = 2, - shiftwidth = 2, - smartindent = true, - list = true, - listchars = 'trail:·,tab: ', - linebreak = true, - formatoptions = 'crql1jn', - synmaxcol = 200, - lazyredraw = true, - scrolloff = 8, - sidescrolloff = 15, - mouse = 'a', - splitright = true, - splitbelow = true, - errorbells = false, - visualbell = true, - backup = false, - writebackup = false, - swapfile = false, - timeout = true, - timeoutlen = 150, - hidden = true, - shortmess = 'filnxToOFIac', - history = 1000, - undofile = true, - undodir = vim.fn.stdpath 'data' .. '/undo', - undolevels = 1000, - undoreload = 1000, - spellfile = vim.fn.stdpath 'data' .. '/spell/en.utf-8.add', - ignorecase = true, - smartcase = true, - incsearch = true, - wrapscan = true, - hlsearch = true, - foldmethod = 'syntax', - foldlevel = 99, - foldnestmax = 10, - foldlevelstart = 99, - autowrite = false, - autochdir = false, - autoread = true, - modeline = false, - showmode = false, - showcmd = false, - laststatus = 2, - ruler = false, - number = true, - -- cmdheight = 0, -- TODO: coming soon! -} -for k, v in pairs(options) do - vim.o[k] = v -end - -vim.api.nvim_command 'colorscheme donokai' - -function SynGroup() - local s = vim.fn.synID(vim.fn.line('.'), vim.fn.col('.'), 1) - -- TODO: instead of printing, put it in a popup? virtual text? - print(s .. ': ' .. vim.fn.synIDattr(s, 'name') .. ' -> ' .. vim.fn.synIDattr(vim.fn.synIDtrans(s), 'name')) -end - -vim.api.nvim_create_autocmd("TextYankPost", { - pattern = "*", - callback = function() - vim.highlight.on_yank { higroup = 'Search', timeout = 200 } - end, -}) - -vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*", - callback = function() - vim.lsp.buf.formatting_seq_sync() - end, -}) - -vim.api.nvim_create_autocmd("FileType", { - pattern = "gitcommit", - callback = function() - vim.cmd 'startinsert' - end, -}) - -vim.cmd 'command! W write' - -function NeatFoldText() - -- TODO: finish this! - -- local lines_count = vim.foldend - vim.foldstart + 1 - -- local foldchar = vim.fn.matchstr(vim.fillchars, 'fold:\\zs.') - -- local foldtextstart = vim.fn.strpart('^' . repeat(foldchar, v:foldlevel*2) . line, 0, (winwidth(0)*2)/3) - -- let foldtextend = printf("%s %".(winwidth(0)-20)."dL", foldtextstart, getline(v:foldstart), lines_count) - -- let foldtextlength = strlen(substitute(foldtextstart . foldtextend, '.', 'x', 'g')) + &foldcolumn - -- return printf("%s%d", substitute(getline(v:foldstart), "^.", ">"), lines_count) -end - --- set foldtext=NeatFoldText() - -for _, keys in ipairs { 'jj', 'jJ', 'Jj', 'JJ', 'jk', 'jK', 'Jk', 'JK' } do - vim.api.nvim_set_keymap('i', keys, '', {}) -end - -local m = { - s = { silent = true }, - n = { noremap = true }, - sn = { silent = true, noremap = true }, -} -local keymap = { - n = { - ['/'] = { ':let @/ = "":', m.s }, - - ['r'] = { ':luafile ' .. vim.g.vimdir .. '/init.lua:echo \'Reloaded init.lua\'', m.s }, - ['gv'] = { ':e ' .. vim.g.vimdir .. '/init.lua', m.s }, - - ['w'] = { ':bd', m.s }, - ['h'] = { ':b#', m.s }, - ['k'] = { ':bnext', m.s }, - ['j'] = { ':bprevious', m.s }, - - ['s'] = "SessionToggleecho 'Persisting Session: ' .. g:persisting .. ' (' .. getcwd() .. ')'", - ['S'] = "SessionSaveecho 'Saved Session: ' .. getcwd()", - ['l'] = "SessionLoadecho 'Loaded Session: ' .. getcwd()", - ['L'] = "SessionLoadLastecho 'Loaded Last Session: ' .. getcwd()", - ['d'] = "SessionDeleteecho 'Deleted Session for cwd: ' .. getcwd()", - - ['t'] = 'Telescope help_tags', - - ['m'] = 'lua SynGroup()', - - [''] = ':qa', - [''] = ':x', - - [''] = 'Telescope git_files', - [''] = 'Telescope live_grep', - [''] = 'Telescope buffers', - - [''] = ':TmuxNavigateLeft', - [''] = ':TmuxNavigateDown', - [''] = ':TmuxNavigateUp', - [''] = ':TmuxNavigateRight', - - [' n'] = "'Nn'[v:searchforward]", - [' N'] = "'nN'[v:searchforward]", - }, - - -- terminal bindings - t = {}, - - [''] = { - [''] = { '', m.sn }, - - -- remove trailing whitespace - [''] = 'mw:%s/\\s\\+$//:let @/ = ""\'w', - ['gs'] = ':setlocal spell!', - [',w'] = { 'CamelCaseMotion_w', m.s }, - [',b'] = { 'CamelCaseMotion_b', m.s }, - [',e'] = { 'CamelCaseMotion_e', m.s }, - [',ge'] = { 'CamelCaseMotion_ge', m.s }, - }, - o = { - ['ib'] = { 'CamelCaseMotion_ib', m.s }, - ['ie'] = { 'CamelCaseMotion_ie', m.s }, - }, - x = { - ['<'] = ''] = '>gv', - ['ib'] = { 'CamelCaseMotion_ib', m.s }, - ['ie'] = { 'CamelCaseMotion_ie', m.s }, - }, - i = { - [''] = '', - [''] = ':x', - }, -} -for mode, mappings in pairs(keymap) do - for key, bind in pairs(mappings) do - if type(bind) == 'table' then - vim.api.nvim_set_keymap(mode, key, bind[1], bind[2]) - else - vim.api.nvim_set_keymap(mode, key, bind, {}) - end - end -end - -local status_line_max_length = 5 - --- TODO: only update this portion when needed instead of every render? -local status_line_buffer_by_num = function(bufnum) - local is_active = false - local bufinfo = vim.fn.getbufinfo(bufnum)[1] - local prefix = ' %#InactiveBuffer#' - local suffix = '%* ' - - if bufinfo.changed == 1 then - prefix = '%#DirtyBuffer# ' - suffix = ' %*' - end - - local windex = vim.fn.index(bufinfo.windows, vim.g.statusline_winid) - if bufinfo.hidden and windex >= 0 then - is_active = true - prefix = '%#ActiveBuffer# ' - suffix = ' %*' - if bufinfo.changed == 1 then - prefix = '%#ActiveDirtyBuffer# *' - suffix = ' %*' - end - end - - return (prefix .. vim.fn.fnamemodify(vim.fn.bufname(bufnum), ':t') .. suffix), is_active -end - -local status_line_buffers = function() - local active_index = -1 - local acc = {} - for _, bufnum in ipairs(vim.api.nvim_list_bufs()) do - local bufinfo = vim.fn.getbufinfo(bufnum)[1] - if bufinfo.listed ~= 0 then - local entry, is_active = status_line_buffer_by_num(bufnum) - table.insert(acc, entry) - if is_active then - active_index = #acc - end - end - end - if active_index >= 0 then - local offset = status_line_max_length / 2 - local min_buf_num = math.max(0, (active_index - offset)) - local max_buf_num = math.min(#acc - 1, min_buf_num + status_line_max_length - 1) - min_buf_num = math.max(0, max_buf_num - status_line_max_length + 1) - local buflist = table.concat({ unpack(acc, min_buf_num + 1, max_buf_num + 1) }, '') - local prefix = '' - local suffix = '' - if min_buf_num > 0 then - prefix = '< ' - end - if max_buf_num < (#acc - 1) then - suffix = ' >' - end - return prefix .. buflist .. suffix - else - local suffix = '' - if #acc - 1 > status_line_max_length then - suffix = ' >' - end - local buflist = table.concat({ unpack(acc, 1, math.min(#acc, status_line_max_length)) }, '') - return buflist .. suffix .. active_index - end -end - -local whitespace = function() - local result = "" - if vim.o.expandtab == true then - result = result .. vim.o.shiftwidth .. "S" - else - result = result .. vim.o.tabstop .. "T" - end - return result -end - -function StatusLine() - return status_line_buffers() .. '%*%=%{&filetype} %l;%c (%p%%/%L) ' .. whitespace() -end - -vim.o.statusline = '%!v:lua.StatusLine()' - -local lsp = require 'lspconfig' --- local coq = require'coq' - -local lsp_format = require 'lsp-format' - -local on_attach = function(client, bufnr) - lsp_format.on_attach(client) - - local lsp_mappings = { - ['n'] = { - ['e'] = 'vim.diagnostic.open_float()', - [''] = 'vim.lsp.buf.signature_help()', - ['gi'] = 'vim.lsp.buf.implementation()', - ['K'] = 'vim.lsp.buf.hover()', - ['gd'] = 'vim.lsp.buf.definition()', - ['gD'] = 'vim.lsp.buf.declaration()', - ['g['] = 'vim.diagnostic.goto_prev()', - ['g]'] = 'vim.diagnostic.goto_next()', - ['wa'] = 'vim.lsp.buf.add_workspace_folder()', - ['wr'] = 'vim.lsp.buf.remove_workspace_folder()', - ['wl'] = 'print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', - ['D'] = 'vim.lsp.buf.type_definition()', - ['rn'] = 'vim.lsp.buf.rename()', - ['ca'] = 'vim.lsp.buf.code_action()', - ['gr'] = 'vim.lsp.buf.references()', - ['f'] = 'vim.lsp.buf.formatting_seq_sync()', - } - } - - for mode, mappings in pairs(lsp_mappings) do - for keys, script in pairs(mappings) do - vim.api.nvim_buf_set_keymap(bufnr, mode, keys, 'lua ' .. script .. '', m.sn) - end - end -end - ---[[ - -set els_path ~/.local/share/nvim/lsp_servers/elixir -curl -fLO https://github.com/elixir-lsp/elixir-ls/releases/latest/download/elixir-ls.zip -mkdir -p $els_path -unzip elixir-ls.zip -d $els_path/elixir-ls/ -chmod +x $els_path/elixir-ls/language_server.sh - -]] -- - -local lsp_configs = { - ansiblels = {}, - bashls = {}, - clangd = {}, - denols = { - root_dir = lsp.util.root_pattern("deno.json"), - }, - diagnosticls = {}, - dockerls = {}, - elixirls = { - cmd = { vim.fn.expand '~/.local/share/nvim/lsp_servers/elixir/elixir-ls/language_server.sh' }, - settings = { - elixirLS = { - dialyzerEnabled = true, - fetchDeps = false, - } - } - }, - gopls = {}, - nimls = {}, - openscad_ls = {}, - pylsp = {}, - rnix = {}, - rust_analyzer = {}, - sqlls = {}, - sumneko_lua = { - settings = { - Lua = { - diagnostics = { - globals = { 'vim' } - } - } - } - }, - terraform_lsp = {}, - tflint = {}, - vimls = {}, - -- tsserver = {}, - yamlls = {}, -} - -local capabilities = require 'cmp_nvim_lsp'.update_capabilities(vim.lsp.protocol.make_client_capabilities()) -local common_config = { - capabilities = capabilities, - on_attach = on_attach, - flags = { - debounce_text_changes = 150 - }, -} - -for server, config in pairs(lsp_configs) do - for k, v in pairs(common_config) do config[k] = v end - lsp[server].setup(config) -end - -require 'nvim-lsp-installer'.setup { - automatic_installation = true, -} diff --git a/common/wezterm/.gitkeep b/common/wezterm/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/os/linux/dotfiles-setup.d.fish b/os/linux/dotfiles-setup.d.fish index b83cb7c..20aecba 100644 --- a/os/linux/dotfiles-setup.d.fish +++ b/os/linux/dotfiles-setup.d.fish @@ -10,6 +10,7 @@ l sway/mimeapps.list $c/mimeapps.list l sway/mimeapps.list $c/sway-mimeapps.list l sway/mimeapps.list $h/.local/share/applications/mimeapps.list l sway/lock $c/swaylock/config +l hypr $c/hypr l mako $c/mako l kanshi $c/kanshi l gtk/2rc $h/.gtkrc-2.0 diff --git a/os/linux/hypr/hyprland.conf b/os/linux/hypr/hyprland.conf new file mode 100644 index 0000000..10dd729 --- /dev/null +++ b/os/linux/hypr/hyprland.conf @@ -0,0 +1,163 @@ +# See https://wiki.hyprland.org/Configuring/Monitors/ +monitor=,preferred,auto,auto + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more + +# Execute your favorite apps at launch +exec-once = kitty & firefox & wezterm + +# Source a file (multi-file configs) +# source = ~/.config/hypr/myColors.conf + +# Some default env vars. +env = XCURSOR_SIZE,24 + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 0 + + keyboard { + repeat_delay 200 + repeat_rate 60 + } + + touchpad { + natural_scroll = no + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 5 + gaps_out = 20 + border_size = 2 + col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + col.inactive_border = rgba(595959aa) + + layout = dwindle +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 10 + blur = yes + blur_size = 3 + blur_passes = 1 + blur_new_optimizations = on + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = off +} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more +device:epic-mouse-v1 { + sensitivity = -0.5 +} + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, Q, exec, kitty +bind = $mainMod, U, exec, firefox +bind = $mainMod, ret, exec, kitty +bind = $mainMod, return, exec, kitty +bind = $mainMod, C, killactive, +bind = $mainMod, M, exit, +bind = $mainMod, E, exec, dolphin +bind = $mainMod, V, togglefloating, +bind = $mainMod, R, exec, wofi --show drun +bind = $mainMod, S, pseudo, # dwindle +bind = $mainMod, P, togglesplit, # dwindle + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d +bind = $mainMod, h, movefocus, l +bind = $mainMod, l, movefocus, r +bind = $mainMod, k, movefocus, u +bind = $mainMod, j, movefocus, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow