Update dotfiles

This commit is contained in:
2024-05-23 17:13:31 -05:00
parent 7f079a205e
commit b413c6186a
5 changed files with 48 additions and 19 deletions

View File

@@ -1,4 +1,5 @@
vim.g.mapleader=',' vim.g.mapleader=','
vim.g.maplocalleader=','
vim.keymap.set('n', '<C-h>', '<C-w>h') vim.keymap.set('n', '<C-h>', '<C-w>h')
vim.keymap.set('n', '<C-j>', '<C-w>j') vim.keymap.set('n', '<C-j>', '<C-w>j')
@@ -8,3 +9,7 @@ vim.keymap.set('n', '<C-l>', '<C-w>l')
vim.keymap.set('n', '<leader>ff', ':FzfLua files<CR>') vim.keymap.set('n', '<leader>ff', ':FzfLua files<CR>')
vim.keymap.set('n', '<leader>fb', ':FzfLua buffers<CR>') vim.keymap.set('n', '<leader>fb', ':FzfLua buffers<CR>')
vim.keymap.set('n', '<leader>rg', ':FzfLua grep<CR>') vim.keymap.set('n', '<leader>rg', ':FzfLua grep<CR>')
vim.keymap.set('i', '<S-Tab>', '<C-d>')
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)

View File

@@ -17,7 +17,6 @@ local plugins = {
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path', 'hrsh7th/cmp-path',
'L3MON4D3/LuaSnip',
'rust-lang/rust.vim', 'rust-lang/rust.vim',
@@ -27,6 +26,12 @@ local plugins = {
opts={}, opts={},
}, },
{
'kaarmu/typst.vim',
ft = 'typst',
lazy = false,
},
} }
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"

View File

@@ -1,8 +1,30 @@
local capabilities = require('cmp_nvim_lsp').default_capabilities() local capabilities = require('cmp_nvim_lsp').default_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = false;
local lspconfig = require('lspconfig') local lspconfig = require('lspconfig')
local servers = {'ccls', 'rust_analyzer'} lspconfig.rust_analyzer.setup {
capabilities = capabilities,
settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
},
imports = {
group = {
enable = false,
},
},
completion = {
postfix = {
enable = false,
},
},
},
},
}
local servers = {'ccls', 'typst_lsp'}
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
lspconfig[lsp].setup { lspconfig[lsp].setup {
@@ -10,24 +32,11 @@ for _, lsp in ipairs(servers) do
} }
end end
local luasnip = require 'luasnip'
local cmp = require 'cmp' local cmp = require 'cmp'
cmp.setup { cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end
},
preselect = cmp.PreselectMode.None, preselect = cmp.PreselectMode.None,
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-Space>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback) ['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
@@ -45,7 +54,6 @@ cmp.setup {
}), }),
sources = { sources = {
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' }, { name = 'path' },
}, },
} }

View File

@@ -33,6 +33,8 @@ vim.opt.report=0
vim.opt.list=true vim.opt.list=true
vim.opt.completeopt=menuone,noselect vim.opt.completeopt=menuone,noselect
vim.opt.undofile=true
vim.g['loaded_perl_provider']=0 vim.g['loaded_perl_provider']=0
vim.g['python3_host_prog']='/usr/bin/python' vim.g['python3_host_prog']='/usr/bin/python'

View File

@@ -21,6 +21,12 @@ bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym $mod+Alt+a exec ydotool key 42:1 54:1 54:0 42:0 40:1 40:0 42:1 54:1 54:0 42:0
bindsym $mod+Alt+o exec ydotool key 42:1 54:1 54:0 42:0 39:1 39:0 42:1 54:1 54:0 42:0
bindsym $mod+Alt+u exec ydotool key 42:1 54:1 54:0 42:0 26:1 26:0 42:1 54:1 54:0 42:0
bindsym $mod+Alt+s exec ydotool key 42:1 54:1 54:0 42:0 12:1 12:0 42:1 54:1 54:0 42:0
### Idle configuration ### Idle configuration
exec swayidle -w \ exec swayidle -w \
@@ -39,7 +45,8 @@ input type:touchpad {
} }
input type:keyboard { input type:keyboard {
xkb_options caps:escape, xkb_layout us,de
xkb_options caps:escape,grp:shifts_toggle
} }
### Key bindings ### Key bindings
@@ -49,7 +56,6 @@ bindsym XF86MonBrightnessUp exec light -A 5
bindsym $mod+Shift+s exec grim -g "$(slurp)" bindsym $mod+Shift+s exec grim -g "$(slurp)"
floating_modifier $mod normal floating_modifier $mod normal
@@ -118,6 +124,9 @@ bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9 bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10 bindsym $mod+Shift+0 move container to workspace number 10
for_window [app_id="simmer505.waywrite"] floating enable
for_window [app_id="org.speedcrunch.speedcrunch"] floating enable
# Horizontal and vertical splits # Horizontal and vertical splits
bindsym $mod+b splith bindsym $mod+b splith
bindsym $mod+v splitv bindsym $mod+v splitv
@@ -191,7 +200,7 @@ client.urgent $urgent-bg-color $urgent-bg-color $text-color
default_border pixel 4 default_border pixel 4
font pango:SourceCodePro Medium 0 font pango:SourceCodePro Medium 1