summaryrefslogtreecommitdiff
path: root/base/config
diff options
context:
space:
mode:
Diffstat (limited to 'base/config')
-rw-r--r--base/config/.nolink0
-rw-r--r--base/config/i3/.nolink0
-rw-r--r--base/config/i3/autostart.d/.nolink0
-rw-r--r--base/config/i3/autostart.d/10_xautolock2
-rw-r--r--base/config/i3/autostart.d/20_gpg-agent2
-rw-r--r--base/config/i3/config.d/.nolink0
-rw-r--r--base/config/i3/config.d/00_base_config194
-rw-r--r--base/config/nvim/init.vim49
-rw-r--r--base/config/nvim/rust.vim102
9 files changed, 349 insertions, 0 deletions
diff --git a/base/config/.nolink b/base/config/.nolink
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/base/config/.nolink
diff --git a/base/config/i3/.nolink b/base/config/i3/.nolink
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/base/config/i3/.nolink
diff --git a/base/config/i3/autostart.d/.nolink b/base/config/i3/autostart.d/.nolink
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/base/config/i3/autostart.d/.nolink
diff --git a/base/config/i3/autostart.d/10_xautolock b/base/config/i3/autostart.d/10_xautolock
new file mode 100644
index 0000000..b72d673
--- /dev/null
+++ b/base/config/i3/autostart.d/10_xautolock
@@ -0,0 +1,2 @@
+exec --no-startup-id xset s 180 120
+exec --no-startup-id xss-lock -n dim-screen.sh -l lock
diff --git a/base/config/i3/autostart.d/20_gpg-agent b/base/config/i3/autostart.d/20_gpg-agent
new file mode 100644
index 0000000..cec15e2
--- /dev/null
+++ b/base/config/i3/autostart.d/20_gpg-agent
@@ -0,0 +1,2 @@
+exec --no-startup-id gpg-agent --daemon --enable-ssh-support --write-env-file "${HOME}/.gpg-agent-info"
+
diff --git a/base/config/i3/config.d/.nolink b/base/config/i3/config.d/.nolink
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/base/config/i3/config.d/.nolink
diff --git a/base/config/i3/config.d/00_base_config b/base/config/i3/config.d/00_base_config
new file mode 100644
index 0000000..c373851
--- /dev/null
+++ b/base/config/i3/config.d/00_base_config
@@ -0,0 +1,194 @@
+#
+# This is my base i3 config which is shared between all hosts.
+#
+
+set $mod Mod4
+floating_modifier $mod
+
+## Visual Settings
+font xft:Inconsolata 8
+hide_edge_borders both
+
+## Bindings to start programs
+bindsym $mod+space exec dmenu_run -l 20
+bindsym $mod+Return exec i3-sensible-terminal
+
+# kill focused window
+bindsym $mod+Shift+Q kill
+
+
+## Bindings to control windows
+
+### Focus Commands
+bindsym $mod+h focus left
+bindsym $mod+j focus down
+bindsym $mod+k focus up
+bindsym $mod+l focus right
+bindsym Mod1+Tab focus right
+bindsym Mod1+Shift+Tab focus left
+bindsym $mod+a focus parent
+bindsym $mod+d focus child
+
+### Window Moving Commands
+bindsym $mod+Shift+H move left
+bindsym $mod+Shift+J move down
+bindsym $mod+Shift+K move up
+bindsym $mod+Shift+L move right
+
+### Floating Windows
+bindsym $mod+Shift+space floating toggle
+bindsym $mod+Tab focus mode_toggle
+
+## Layout Commands
+bindsym $mod+s layout stacking
+bindsym $mod+w layout tabbed
+bindsym $mod+e layout default
+bindsym $mod+v split v
+bindsym $mod+Shift+V split h
+bindsym $mod+f fullscreen
+
+
+## Bindings to control workspaces
+
+### Switch Workspaces
+bindsym $mod+1 workspace number "1: mail"
+bindsym $mod+2 workspace number "2: web"
+bindsym $mod+3 workspace number "3: dev"
+bindsym $mod+4 workspace number 4
+bindsym $mod+5 workspace number 5
+bindsym $mod+6 workspace number 6
+bindsym $mod+7 workspace number 7
+bindsym $mod+8 workspace number 8
+bindsym $mod+9 workspace number 9
+bindsym $mod+0 workspace number 10
+bindsym $mod+Left workspace prev_on_output
+bindsym $mod+Right workspace next_on_output
+
+### Move container to workspace
+bindsym $mod+Shift+exclam move workspace number "1: mail"
+bindsym $mod+Shift+at move workspace number "2: web"
+bindsym $mod+Shift+numbersign move workspace number "3: dev"
+bindsym $mod+Shift+dollar move workspace number 4
+bindsym $mod+Shift+percent move workspace number 5
+bindsym $mod+Shift+asciicircum move workspace number 6
+bindsym $mod+Shift+ampersand move workspace number 7
+bindsym $mod+Shift+asterisk move workspace number 8
+bindsym $mod+Shift+parenleft move workspace number 9
+bindsym $mod+Shift+parenright move workspace number 10
+bindsym $mod+Shift+Left move workspace prev
+bindsym $mod+Shift+Right move workspace next
+
+### Move workspace to different monitor
+bindsym $mod+Mod1+Left move workspace to output left
+bindsym $mod+Mod1+Right move workspace to output right
+bindsym $mod+Mod1+Up move workspace to output up
+bindsym $mod+Mod1+Down move workspace to output down
+
+workspace_auto_back_and_forth yes
+workspace_layout default
+
+### Workspace monitor assignments
+
+workspace "1: mail" output eDP-1
+workspace "2: web" output DP-1
+workspace "3: dev" output DP-1
+workspace 4 output DP-1
+workspace 5 output DP-1
+workspace 6 output DP-1
+workspace 7 output DP-1
+workspace 8 output DP-1
+workspace 9 output DP-1
+workspace 10 output DP-1
+
+### Scratchpad
+bindsym $mod+Shift+minus move scratchpad
+bindsym $mod+minus scratchpad show
+
+
+## Bindings to contorl the session
+bindsym $mod+Shift+C exec "make_i3_config > $HOME/.config/i3/config"; reload
+bindsym $mod+Shift+R restart
+bindsym $mod+Shift+E exit
+bindsym Control+mod1+l exec $HOME/bin/lock
+
+
+## Alternative modes
+
+### Resize Mode
+bindsym $mod+r mode "resize"
+mode "resize" {
+ bindsym h resize shrink left 10 px or 10 ppt
+ bindsym Shift+H resize grow left 10 px or 10 ppt
+ bindsym j resize shrink down 10 px or 10 ppt
+ bindsym Shift+j resize grow down 10 px or 10 ppt
+ bindsym k resize shrink up 10 px or 10 ppt
+ bindsym Shift+K resize grow up 10 px or 10 ppt
+ bindsym l resize shrink right 10 px or 10 ppt
+ bindsym Shift+L resize grow right 10 px or 10 ppt
+
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+}
+
+### Display Settings
+set $displayMode "Choose [l]aptop or [d]esktop, [e]xtend, [m]irror"
+bindsym $mod+p mode $displayMode
+mode $displayMode {
+ bindsym l exec "\
+ xrandr --output eDP-1 --mode 1920x1080 --primary && \
+ xrandr --output DP-1 --off"; mode "default"
+ bindsym d exec "\
+ xrandr --output DP-1 --auto --primary && \
+ xrandr --output eDP-1 --off"; mode "default"
+ bindsym e exec "\
+ xrandr --output eDP-1 --mode 1920x1080 --primary && \
+ xrandr --output DP-1 --above eDP-1 --mode 1920x1080 \
+ "; mode "default"
+ bindsym m exec "\
+ xrandr --output eDP-1 --mode 1920x1080 --primary && \
+ xrandr --output DP-1 --same-as eDP-1 --auto \
+ "; mode "default"
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+}
+
+## i3bar Settings
+bar {
+ status_command conky-i3bar
+ position bottom
+ tray_output primary
+ font xft:Inconsolata 9
+}
+
+
+## Misc. Bindings
+
+## sshclip
+bindsym $mod+g exec sshclip
+
+bindsym $mod+c exec clipmv
+
+### Music
+bindsym XF86AudioPlay exec xmms2 toggle
+bindsym $mod+End exec xmms2 toggle
+bindsym XF86AudioNext exec xmms2 next
+bindsym $mod+Home exec xmms2 next
+bindsym XF86AudioPrev exec xmms2 prev
+
+### Volume
+bindsym XF86AudioRaiseVolume exec "amixer -D pulse -q set Master 5%+ unmute; amixer -D pulse -q set Speaker unmute"
+bindsym $mod+Prior exec "amixer -D pulse -q set Master 5%+ unmute; amixer -D pulse -q set Speaker unmute"
+bindsym XF86AudioLowerVolume exec "amixer -D pulse -q set Master 5%- unmute; amixer -D pulse -q set Speaker unmute"
+bindsym $mod+Next exec "amixer -D pulse -q set Master 5%- unmute; amixer -D pulse -q set Speaker unmute"
+bindsym XF86AudioMute exec amixer -D pulse -q set Master mute
+
+### Brightness
+bindsym XF86MonBrightnessUp exec "brightnessctl set +5%"
+bindsym XF86MonBrightnessDown exec "brightnessctl set 5%-"
+
+## Specific Window Settings
+for_window [class="Gcalctool"] floating enable
+for_window [class="Gnome-calculator"] floating enable
+for_window [class="file_progress"] floating enable
+for_window [title="Unlock Database - KeePassXC"] floating enable
+
diff --git a/base/config/nvim/init.vim b/base/config/nvim/init.vim
new file mode 100644
index 0000000..18324af
--- /dev/null
+++ b/base/config/nvim/init.vim
@@ -0,0 +1,49 @@
+set runtimepath^=~/.vim runtimepath+=~/.vim/after
+let &packpath = &runtimepath
+source ~/.vimrc
+
+call plug#begin('~/.vim/plugged')
+
+" Collection of common configurations for the Nvim LSP client
+Plug 'neovim/nvim-lspconfig'
+
+" Completion framework
+Plug 'hrsh7th/nvim-cmp'
+
+" LSP completion source for nvim-cmp
+Plug 'hrsh7th/cmp-nvim-lsp'
+
+" Snippet completion source for nvim-cmp
+Plug 'hrsh7th/cmp-vsnip'
+
+" Other usefull completion sources
+Plug 'hrsh7th/cmp-path'
+Plug 'hrsh7th/cmp-buffer'
+
+" See hrsh7th's other plugins for more completion sources!
+
+" To enable more of the features of rust-analyzer, such as inlay hints and more!
+Plug 'simrat39/rust-tools.nvim'
+
+" Snippet engine
+Plug 'hrsh7th/vim-vsnip'
+
+" Fuzzy finder
+" Optional
+Plug 'nvim-lua/popup.nvim'
+Plug 'nvim-lua/plenary.nvim'
+Plug 'nvim-telescope/telescope.nvim'
+
+" Color Scheme
+Plug 'arcticicestudio/nord-vim'
+
+Plug 'vim-airline/vim-airline'
+Plug 'airblade/vim-gitgutter'
+Plug 'tpope/vim-fugitive'
+
+call plug#end()
+
+colorscheme nord
+
+source ~/.config/nvim/rust.vim
+
diff --git a/base/config/nvim/rust.vim b/base/config/nvim/rust.vim
new file mode 100644
index 0000000..81ce516
--- /dev/null
+++ b/base/config/nvim/rust.vim
@@ -0,0 +1,102 @@
+" Set completeopt to have a better completion experience
+" :help completeopt
+" menuone: popup even when there's only one match
+" noinsert: Do not insert text until a selection is made
+" noselect: Do not select, force user to select one from the menu
+set completeopt=menuone,noinsert,noselect
+
+" Avoid showing extra messages when using completion
+set shortmess+=c
+
+" Configure LSP through rust-tools.nvim plugin.
+" rust-tools will configure and enable certain LSP features for us.
+" See https://github.com/simrat39/rust-tools.nvim#configuration
+lua <<EOF
+local nvim_lsp = require'lspconfig'
+
+local opts = {
+ tools = { -- rust-tools options
+ autoSetHints = true,
+ hover_with_actions = true,
+ inlay_hints = {
+ show_parameter_hints = false,
+ parameter_hints_prefix = "",
+ other_hints_prefix = "",
+ },
+ },
+
+ -- all the opts to send to nvim-lspconfig
+ -- these override the defaults set by rust-tools.nvim
+ -- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
+ server = {
+ -- on_attach is a callback called when the language server attachs to the buffer
+ -- on_attach = on_attach,
+ settings = {
+ -- to enable rust-analyzer settings visit:
+ -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
+ ["rust-analyzer"] = {
+ -- enable clippy on save
+ checkOnSave = {
+ command = "clippy"
+ },
+ }
+ }
+ },
+}
+
+require('rust-tools').setup(opts)
+EOF
+
+" Setup Completion
+" See https://github.com/hrsh7th/nvim-cmp#basic-configuration
+lua <<EOF
+local cmp = require'cmp'
+cmp.setup({
+ -- Enable LSP snippets
+ snippet = {
+ expand = function(args)
+ vim.fn["vsnip#anonymous"](args.body)
+ end,
+ },
+ mapping = {
+ ['<C-p>'] = cmp.mapping.select_prev_item(),
+ ['<C-n>'] = cmp.mapping.select_next_item(),
+ -- Add tab support
+ ['<S-Tab>'] = cmp.mapping.select_prev_item(),
+ ['<Tab>'] = cmp.mapping.select_next_item(),
+ ['<C-d>'] = cmp.mapping.scroll_docs(-4),
+ ['<C-f>'] = cmp.mapping.scroll_docs(4),
+ ['<C-Space>'] = cmp.mapping.complete(),
+ ['<C-e>'] = cmp.mapping.close(),
+ ['<CR>'] = cmp.mapping.confirm({
+ behavior = cmp.ConfirmBehavior.Insert,
+ select = true,
+ })
+ },
+
+ -- Installed sources
+ sources = {
+ { name = 'nvim_lsp' },
+ { name = 'vsnip' },
+ { name = 'path' },
+ { name = 'buffer' },
+ },
+})
+EOF
+
+" Code navigation shortcuts
+nnoremap <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<CR>
+nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
+nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<CR>
+nnoremap <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
+nnoremap <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<CR>
+nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
+nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
+nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
+nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
+
+nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR>
+
+" Goto previous/next diagnostic warning/error
+nnoremap <silent> g[ <cmd>lua vim.diagnostic.goto_prev()<CR>
+nnoremap <silent> g] <cmd>lua vim.diagnostic.goto_next()<CR>