Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
|
8c71d70a46 | ||
0c5298af84 | |||
988fd01ab7 |
11 changed files with 74 additions and 172 deletions
|
@ -15,13 +15,31 @@ shopt -s histappend
|
||||||
[[ -f $HOME/.bash_colors ]] && source "$HOME/.bash_colors"
|
[[ -f $HOME/.bash_colors ]] && source "$HOME/.bash_colors"
|
||||||
[[ -f $HOME/.bash_functions ]] && source "$HOME/.bash_functions"
|
[[ -f $HOME/.bash_functions ]] && source "$HOME/.bash_functions"
|
||||||
|
|
||||||
|
if ! shopt -oq posix; then
|
||||||
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
|
. /usr/share/bash-completion/bash_completion
|
||||||
|
elif [ -f /etc/bash_completion ]; then
|
||||||
|
. /etc/bash_completion
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
while read -r completion ; do source "$completion" ; done < <(find $HOME/.bash_completion/*)
|
||||||
|
|
||||||
# Save working dir on every prompt.
|
# Save working dir on every prompt.
|
||||||
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"; pwd > $HOME/.cwd'
|
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"; pwd > $HOME/.cwd'
|
||||||
export PS1="${Yellow}\d \A ${Off}${Green}\u@\h: ${Off}\w ${Red}\$(parse_branch git)${BRed}\$(parse_branch fossil)${Off}\n-$ "
|
export PS1="${Red}\d \A ${Blue}\u@\h: ${Off}\w ${BGreen}\$(parse_branch git)${BPurple}\$(parse_branch fossil)${Off}\n-$ "
|
||||||
|
|
||||||
|
# set variable identifying the chroot you work in (used in the prompt below)
|
||||||
|
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||||
|
debian_chroot=$(cat /etc/debian_chroot)
|
||||||
|
fi
|
||||||
|
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||||
|
|
||||||
|
# check the window size after each command and, if necessary,
|
||||||
|
# update the values of LINES and COLUMNS.
|
||||||
|
shopt -s checkwinsize
|
||||||
|
|
||||||
# Use fzf if installed.
|
# Use fzf if installed.
|
||||||
hash fzf 2>/dev/null && eval "$(fzf --bash)"
|
export FZF_DEFAULT_OPTS='--border=horizontal --info=inline --no-reverse --height=30%'
|
||||||
export FZF_DEFAULT_OPTS='--border=horizontal --info=inline --no-reverse --height=50%'
|
|
||||||
|
|
||||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
[general]
|
live_config_reload = true
|
||||||
|
working_directory = "None"
|
||||||
|
|
||||||
import = [
|
import = [
|
||||||
"~/.config/alacritty/light.toml"
|
"~/.config/alacritty/light.toml"
|
||||||
]
|
]
|
||||||
live_config_reload = true
|
|
||||||
working_directory = "None"
|
|
||||||
|
|
||||||
[cursor]
|
[cursor]
|
||||||
thickness = 0.2
|
thickness = 0.2
|
||||||
|
@ -13,7 +13,7 @@ style = "Block"
|
||||||
TERM = "alacritty"
|
TERM = "alacritty"
|
||||||
|
|
||||||
[font]
|
[font]
|
||||||
size = 11
|
size = 10
|
||||||
|
|
||||||
[font.bold]
|
[font.bold]
|
||||||
family = "monospace"
|
family = "monospace"
|
||||||
|
@ -414,7 +414,7 @@ history = 100000
|
||||||
save_to_clipboard = true
|
save_to_clipboard = true
|
||||||
semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"
|
semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"
|
||||||
|
|
||||||
[terminal.shell]
|
[shell]
|
||||||
program = "/bin/bash"
|
program = "/bin/bash"
|
||||||
|
|
||||||
[window]
|
[window]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[storage]
|
[storage]
|
||||||
driver = "overlay"
|
driver = "overlay"
|
||||||
runroot = "/run/user/1000"
|
runroot = "/run/user/1000"
|
||||||
graphroot = "/home/vladan/.local/share/containers/storage"
|
graphroot = "/home/vladanpopovic/.local/share/containers/storage"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[user]
|
[user]
|
||||||
email = vladanovic@gmail.com
|
email = vladan.popovic@hm.com
|
||||||
name = Vladan Popovic
|
name = Vladan Popovic
|
||||||
[core]
|
[core]
|
||||||
excludesfile = /home/vladan/.config/git/ignore
|
excludesfile = /home/vladan/.config/git/ignore
|
||||||
|
|
|
@ -19,6 +19,7 @@ local common_on_attach = function(client, bufnr)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Use vim's default coloring.
|
-- Use vim's default coloring.
|
||||||
client.server_capabilities.semanticTokensProvider = nil
|
client.server_capabilities.semanticTokensProvider = nil
|
||||||
for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
|
for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
|
||||||
|
@ -26,29 +27,29 @@ local common_on_attach = function(client, bufnr)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- LSP diagnostics.
|
local nvim_lsp = require('lspconfig')
|
||||||
vim.lsp.handlers["textDocument/publishDiagnostics"] =
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
|
||||||
virtual_text = false,
|
|
||||||
underline = true,
|
|
||||||
signs = true,
|
|
||||||
update_in_insert = false
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Setup rust outside of lspconfig.
|
-- LSPs
|
||||||
vim.g.rustaceanvim = function()
|
local servers = {
|
||||||
return {
|
"clangd",
|
||||||
-- Plugin configuration.
|
"gleam",
|
||||||
tools = {
|
"lua_ls",
|
||||||
},
|
"ocamllsp",
|
||||||
-- LSP configuration.
|
"pyright",
|
||||||
server = {
|
"rnix",
|
||||||
on_attach = function(client, bufnr)
|
"terraformls",
|
||||||
common_on_attach(client, bufnr)
|
"vimls",
|
||||||
end,
|
}
|
||||||
default_settings = {
|
for _, lsp in ipairs(servers) do
|
||||||
-- rust-analyzer language server configuration
|
nvim_lsp[lsp].setup { capabilities = capabilities, on_attach = common_on_attach }
|
||||||
['rust-analyzer'] = {
|
end
|
||||||
|
|
||||||
|
nvim_lsp.rust_analyzer.setup({
|
||||||
|
on_attach = common_on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
imports = {
|
imports = {
|
||||||
granularity = {
|
granularity = {
|
||||||
group = "module",
|
group = "module",
|
||||||
|
@ -66,31 +67,9 @@ vim.g.rustaceanvim = function()
|
||||||
checkOnSave = {
|
checkOnSave = {
|
||||||
command = "clippy",
|
command = "clippy",
|
||||||
},
|
},
|
||||||
},
|
|
||||||
},
|
|
||||||
-- DAP configuration.
|
|
||||||
dap = {
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
})
|
||||||
|
|
||||||
local nvim_lsp = require('lspconfig')
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
|
|
||||||
-- LSPs
|
|
||||||
local servers = {
|
|
||||||
"clangd",
|
|
||||||
"lua_ls",
|
|
||||||
"ocamllsp",
|
|
||||||
"pyright",
|
|
||||||
"rnix",
|
|
||||||
"terraformls",
|
|
||||||
"vimls",
|
|
||||||
}
|
|
||||||
for _, lsp in ipairs(servers) do
|
|
||||||
nvim_lsp[lsp].setup { capabilities = capabilities, on_attach = common_on_attach }
|
|
||||||
end
|
|
||||||
|
|
||||||
nvim_lsp.ruff.setup({
|
nvim_lsp.ruff.setup({
|
||||||
on_attach = function (client)
|
on_attach = function (client)
|
||||||
|
@ -105,3 +84,12 @@ nvim_lsp.ruff.setup({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- LSP diagnostics.
|
||||||
|
vim.lsp.handlers["textDocument/publishDiagnostics"] =
|
||||||
|
vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||||
|
virtual_text = false,
|
||||||
|
underline = true,
|
||||||
|
signs = true,
|
||||||
|
update_in_insert = false
|
||||||
|
})
|
||||||
|
|
|
@ -1,89 +0,0 @@
|
||||||
local dap, dapui = require('dap'), require('dapui')
|
|
||||||
|
|
||||||
-- Open dapui once dap starts.
|
|
||||||
dapui.setup()
|
|
||||||
dap.listeners.before.attach.dapui_config = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.before.launch.dapui_config = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_terminated.dapui_config = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_exited.dapui_config = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Keybindings used in probably all editors/IDEs.
|
|
||||||
vim.keymap.set('n', '<F5>', dap.continue)
|
|
||||||
vim.keymap.set('n', '<F10>', dap.step_over)
|
|
||||||
vim.keymap.set('n', '<F11>', dap.step_into)
|
|
||||||
vim.keymap.set('n', '<F12>', dap.step_out)
|
|
||||||
-- Breakpoints.
|
|
||||||
vim.keymap.set('n', '<Leader>b', dap.toggle_breakpoint)
|
|
||||||
vim.keymap.set('n', '<Leader>B', dap.set_breakpoint)
|
|
||||||
vim.keymap.set('n', '<Leader>lp', function() dap.set_breakpoint(nil, nil, vim.fn.input('Log point message: ')) end)
|
|
||||||
-- Repl, run and dap-ui bindings.
|
|
||||||
vim.keymap.set('n', '<Leader>dr', dap.repl.open)
|
|
||||||
vim.keymap.set('n', '<Leader>dl', dap.run_last)
|
|
||||||
vim.keymap.set({'n', 'v'}, '<Leader>dh', function() require('dap.ui.widgets').hover() end)
|
|
||||||
vim.keymap.set({'n', 'v'}, '<Leader>dp', function() require('dap.ui.widgets').preview() end)
|
|
||||||
vim.keymap.set('n', '<Leader>df', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.frames) end)
|
|
||||||
vim.keymap.set('n', '<Leader>ds', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.scopes) end)
|
|
||||||
|
|
||||||
vim.fn.sign_define('DapBreakpoint', {text='', texthl='', linehl='', numhl=''})
|
|
||||||
|
|
||||||
-- Set up lldb (LLVM debugger)
|
|
||||||
-- Install archlinux: sudo pacman -S lldb
|
|
||||||
-- Install ubuntu: sudo apt
|
|
||||||
dap.adapters.lldb = {
|
|
||||||
type = 'server',
|
|
||||||
port = "${port}",
|
|
||||||
executable = {
|
|
||||||
command = '/usr/bin/lldb-dap',
|
|
||||||
args = { "--port", "${port}" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Custom debuggable build runs (on top of rust-analyzer debuggables).
|
|
||||||
local ExecTypes = {
|
|
||||||
TEST = "cargo build --tests -q --message-format=json",
|
|
||||||
BIN = "cargo build -q --message-format=json"
|
|
||||||
}
|
|
||||||
local function runBuild(type)
|
|
||||||
local lines = vim.fn.systemlist(type)
|
|
||||||
local output = table.concat(lines, "\n")
|
|
||||||
local filename = output:match('^.*"executable":"(.*)",.*\n.*,"success":true}$')
|
|
||||||
|
|
||||||
if filename == nil then
|
|
||||||
return error("failed to build cargo project")
|
|
||||||
end
|
|
||||||
|
|
||||||
return filename
|
|
||||||
end
|
|
||||||
-- Custom debuggable configurations.
|
|
||||||
dap.configurations.rust = {
|
|
||||||
{
|
|
||||||
name = "Debug Test",
|
|
||||||
type = "lldb",
|
|
||||||
request = "launch",
|
|
||||||
program = function ()
|
|
||||||
return runBuild(ExecTypes.TEST)
|
|
||||||
end,
|
|
||||||
cwd = "${workspaceFolder}",
|
|
||||||
stopOnEntry = false,
|
|
||||||
showDisassembly = "never"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = "Debug Bin",
|
|
||||||
type = "lldb",
|
|
||||||
request = "launch",
|
|
||||||
program = function ()
|
|
||||||
return runBuild(ExecTypes.BIN)
|
|
||||||
end,
|
|
||||||
cwd = "${workspaceFolder}",
|
|
||||||
stopOnEntry = false,
|
|
||||||
showDisassembly = "never"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,7 +3,6 @@ require('plugins.packer_setup')
|
||||||
require('packer').startup(function()
|
require('packer').startup(function()
|
||||||
-- Packer can manage itself as an optional plugin
|
-- Packer can manage itself as an optional plugin
|
||||||
use { 'wbthomason/packer.nvim', opt = true }
|
use { 'wbthomason/packer.nvim', opt = true }
|
||||||
use { 'glepnir/nerdicons.nvim', cmd = 'NerdIcons', config = function() require('nerdicons').setup({}) end }
|
|
||||||
|
|
||||||
-- Fuzzy finder
|
-- Fuzzy finder
|
||||||
use {
|
use {
|
||||||
|
@ -39,29 +38,14 @@ require('packer').startup(function()
|
||||||
-- LSP and related
|
-- LSP and related
|
||||||
use { 'neovim/nvim-lspconfig' }
|
use { 'neovim/nvim-lspconfig' }
|
||||||
use { 'aznhe21/actions-preview.nvim' }
|
use { 'aznhe21/actions-preview.nvim' }
|
||||||
use { 'folke/trouble.nvim' } -- diagnostics
|
use { 'folke/trouble.nvim' } -- lsp diagnostics
|
||||||
|
|
||||||
-- Plugins to extend builtin lsp
|
-- Plugins to extend builtin language support
|
||||||
use { 'cespare/vim-toml' }
|
use { 'cespare/vim-toml' }
|
||||||
use { 'gleam-lang/gleam.vim' }
|
use { 'gleam-lang/gleam.vim' }
|
||||||
|
use { 'rust-lang/rust.vim' }
|
||||||
use { 'folke/neodev.nvim' }
|
use { 'folke/neodev.nvim' }
|
||||||
use { 'hashivim/vim-terraform' }
|
use { 'hashivim/vim-terraform' }
|
||||||
use {
|
|
||||||
'mrcjkb/rustaceanvim',
|
|
||||||
requires = {
|
|
||||||
'mfussenegger/nvim-dap'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Debugging
|
|
||||||
use { 'mfussenegger/nvim-dap' }
|
|
||||||
use {
|
|
||||||
"rcarriga/nvim-dap-ui",
|
|
||||||
requires = {
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
"nvim-neotest/nvim-nio",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Git
|
-- Git
|
||||||
use {
|
use {
|
||||||
|
@ -86,7 +70,6 @@ end)
|
||||||
|
|
||||||
require('plugins.catppuccin')
|
require('plugins.catppuccin')
|
||||||
require('plugins.cmp')
|
require('plugins.cmp')
|
||||||
require('plugins.dap')
|
|
||||||
require('plugins.gitsigns')
|
require('plugins.gitsigns')
|
||||||
require('plugins.luasnip_config')
|
require('plugins.luasnip_config')
|
||||||
require('plugins.neogit')
|
require('plugins.neogit')
|
||||||
|
|
|
@ -122,9 +122,9 @@
|
||||||
bindsym $mod+z exec swaylock -c 000000
|
bindsym $mod+z exec swaylock -c 000000
|
||||||
|
|
||||||
# Take full screen screenshot with PrtScr
|
# Take full screen screenshot with PrtScr
|
||||||
bindsym Print exec grim -t png ~/screenshot-$(date +%Y-%m-%d-%H%M%S).png
|
bindsym Print exec grim -t png "~/screenshot-$(date +%Y-%m-%d-%H%M%S).png"
|
||||||
# Take area screenshot with Shift+PrtScr
|
# Take area screenshot with Shift+PrtScr
|
||||||
bindsym Shift+Print exec grim -g "$(slurp)" ~/screenshot-$(date +%Y-%m-%d-%H%M%S).png
|
bindsym Shift+Print exec grim -g "$(slurp)" "~/screenshot-$(date +%Y-%m-%d-%H%M%S).png"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Resizing containers:
|
# Resizing containers:
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
},
|
},
|
||||||
"network": {
|
"network": {
|
||||||
"tooltip": false,
|
"tooltip": false,
|
||||||
"interface": "wlp3s0*",
|
"interface": "wlp*",
|
||||||
"format-wifi": " {essid} ({signalStrength}%)",
|
"format-wifi": " {essid} ({signalStrength}%)",
|
||||||
"format-ethernet": "{ifname}: {ipaddr}/{cidr}",
|
"format-ethernet": "{ifname}: {ipaddr}/{cidr}",
|
||||||
"format-linked": "{ifname} (No IP)",
|
"format-linked": "{ifname} (No IP)",
|
||||||
|
|
|
@ -20,3 +20,5 @@ add_path() case :$PATH: in *:$1:*) ;; *) PATH=$1:$PATH;; esac
|
||||||
add_path $HOME/.local/bin
|
add_path $HOME/.local/bin
|
||||||
add_path $PYTHONUSERBASE/bin
|
add_path $PYTHONUSERBASE/bin
|
||||||
add_path $HOME/.cargo/bin
|
add_path $HOME/.cargo/bin
|
||||||
|
add_path $HOME/.kubectl-plugins:$PATH
|
||||||
|
add_path $PATH:/opt/gradle/gradle-8.8/bin
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
default-cache-ttl 3600
|
default-cache-ttl 3600
|
||||||
pinentry-program /usr/bin/pinentry-qt5
|
pinentry-program /usr/bin/pinentry-gnome3
|
||||||
max-cache-ttl 72000
|
max-cache-ttl 72000
|
||||||
default-cache-ttl 72000
|
default-cache-ttl 72000
|
||||||
max-cache-ttl-ssh 72000
|
max-cache-ttl-ssh 72000
|
||||||
|
|
Loading…
Reference in a new issue