mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-03-27 21:47:46 +01:00
Merge branch 'master' of github:tiyn/dotfiles
This commit is contained in:
commit
c17dae6060
@ -110,7 +110,7 @@
|
||||
"clipping-range": 6.0,
|
||||
"fft": "4096",
|
||||
"input-gain": 0.0,
|
||||
"output-gain": -20.0,
|
||||
"output-gain": 15.0,
|
||||
"std": "ISO226-2003",
|
||||
"volume": -6.499999999999993
|
||||
},
|
||||
@ -119,7 +119,7 @@
|
||||
"deesser#0",
|
||||
"filter#0",
|
||||
"gate#0",
|
||||
"rnnoise",
|
||||
"rnnoise#0",
|
||||
"limiter#0",
|
||||
"loudness#0"
|
||||
],
|
||||
|
@ -51,24 +51,31 @@ vim.o.signcolumn = "yes"
|
||||
vim.o.undofile = true
|
||||
vim.o.undodir = vim.env.XDG_CACHE_HOME .. "/vim/undo"
|
||||
|
||||
-- delete trailing whitespaces on save
|
||||
vim.api.nvim_create_autocmd({'BufWritePre'},
|
||||
{pattern = {'*'},
|
||||
command = [[%s/\s\+$//e]],
|
||||
})
|
||||
|
||||
-- python programs to use
|
||||
vim.g.python_host_prog = '/usr/bin/python2'
|
||||
vim.g.python3_host_prog = '/usr/bin/python3'
|
||||
|
||||
-- read files correctly
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
h = 'c',
|
||||
html = 'html',
|
||||
java = 'java',
|
||||
md = 'markdown',
|
||||
nim = 'nim',
|
||||
py = 'python',
|
||||
tex = 'tex',
|
||||
}})
|
||||
|
||||
-- load plugins (autoload all files in plugin folder)
|
||||
require('loadplugins')
|
||||
|
||||
-- load filetype specific mappings and commands
|
||||
require('filetype')
|
||||
require('autocmd')
|
||||
|
||||
-- load general mapped keys
|
||||
require('keymap')
|
||||
|
||||
-- load general colorscheme
|
||||
require('colorscheme')
|
||||
|
||||
|
72
.config/nvim/lua/autocmd.lua
Normal file
72
.config/nvim/lua/autocmd.lua
Normal file
@ -0,0 +1,72 @@
|
||||
-- autocmd
|
||||
|
||||
-- delete trailing whitespaces on save
|
||||
vim.api.nvim_create_autocmd({'BufWritePre'},
|
||||
{pattern = {'*'},
|
||||
command = [[%s/\s\+$//e]],
|
||||
})
|
||||
|
||||
-- formatting options
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'markdown'},
|
||||
command = 'setlocal shiftwidth=2 softtabstop=2',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'java'},
|
||||
command = 'setlocal shiftwidth=2 softtabstop=2',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'javascript'},
|
||||
command = 'setlocal shiftwidth=2 softtabstop=2',
|
||||
})
|
||||
|
||||
-- cleanup certain files after leaving the editor
|
||||
vim.api.nvim_create_autocmd({'VimLeave'},
|
||||
{pattern = {'*.c'},
|
||||
command = '!cclear'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'VimLeave'},
|
||||
{pattern = {'*.tex'},
|
||||
command = '!texclear %'
|
||||
})
|
||||
|
||||
-- highlighting break line
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'c'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'java'},
|
||||
command = 'set colorcolumn=100'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'markdown'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'nim'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'python'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'tex'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
-- conceallevel
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'markdown'},
|
||||
command = 'set conceallevel=2'
|
||||
})
|
||||
|
@ -1,138 +0,0 @@
|
||||
-- filetype
|
||||
|
||||
-- read files correctly
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
['.*.lua'] = 'lua',
|
||||
['.*.h'] = 'c',
|
||||
['.*.html'] = 'html',
|
||||
['.*.nim'] = 'nim',
|
||||
['.*.py'] = 'python',
|
||||
['.*.tex'] = 'tex',
|
||||
}})
|
||||
|
||||
-- formatting options
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'markdown'},
|
||||
command = 'setlocal shiftwidth=2 softtabstop=2',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'java'},
|
||||
command = 'setlocal shiftwidth=2 softtabstop=2',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'javascript'},
|
||||
command = 'setlocal shiftwidth=2 softtabstop=2',
|
||||
})
|
||||
|
||||
-- formatting programs
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'c'},
|
||||
command = 'setlocal formatprg=astyle --mode=c --style=ansi',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'c'},
|
||||
command = 'noremap <F8> gggqG',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'html'},
|
||||
command = 'noremap <F8> :silent %!tidy -q -i --show-errors 0 <CR>',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'java'},
|
||||
command = 'setlocal formatprg=astyle --indent=spaces=2 --style=google',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'java'},
|
||||
command = 'noremap <F8> gggqG',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'markdown'},
|
||||
command = 'noremap <F8> :silent %!prettier --stdin-filepath % <CR>',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'nim'},
|
||||
command = 'noremap <F8> :silent !nimpretty %<CR>',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'nim'},
|
||||
command = 'noremap <F8> gggqG',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'python'},
|
||||
command = 'setlocal formatprg=autopep8 "%"',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'python'},
|
||||
command = 'noremap <F8> gggqG',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'tex', 'latex'},
|
||||
command = 'setlocal formatprg=latexindent',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'tex', 'latex'},
|
||||
command = 'noremap <F8> gggqG',
|
||||
})
|
||||
|
||||
-- cleanup certain files after leaving the editor
|
||||
vim.api.nvim_create_autocmd({'VimLeave'},
|
||||
{pattern = {'*.c'},
|
||||
command = '!cclear'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'VimLeave'},
|
||||
{pattern = {'*.tex'},
|
||||
command = '!texclear %'
|
||||
})
|
||||
|
||||
-- highlighting break line
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'c'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'java'},
|
||||
command = 'set colorcolumn=100'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'markdown'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'nim'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'python'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'tex'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
-- conceallevel
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'markdown'},
|
||||
command = 'set conceallevel=2'
|
||||
})
|
||||
|
@ -65,15 +65,11 @@ vim.api.nvim_set_keymap('n', '<leader>gu', ':diffget //2<CR>', { noremap = true
|
||||
vim.api.nvim_set_keymap('n', '<leader>gs', ':G<CR>', { noremap = true })
|
||||
|
||||
-- hrsh7th/nvim-cmp
|
||||
local on_attach = function(client, bufnr)
|
||||
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
||||
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||
local opts = { noremap=true, silent=true }
|
||||
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
buf_set_keymap('n', 'gy', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
buf_set_keymap('n', '<F5>', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
end
|
||||
vim.api.nvim_set_keymap('n', 'gD', ':lua vim.lsp.buf.declaration()<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', 'gd', ':lua vim.lsp.buf.definition()<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', 'gy', ':lua vim.lsp.buf.type_definition()<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', 'gi', ':lua vim.lsp.buf.implementation()<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', 'gr', ':lua vim.lsp.buf.references()<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', 'K', ':lua vim.lsp.buf.hover()<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', '<F5>', ':lua vim.lsp.buf.rename()<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', '<F8>', ':lua vim.lsp.buf.format()<CR>', { noremap = true })
|
||||
|
@ -16,14 +16,8 @@ local packer_bootstrap = ensure_packer()
|
||||
|
||||
-- load plugins with packer
|
||||
return require("packer").startup(function(use)
|
||||
-- package manager
|
||||
use 'wbthomason/packer.nvim'
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
|
||||
-- automatic closing of brackets
|
||||
use 'raimondi/delimitmate'
|
||||
-- package manager (first entry)
|
||||
use {'wbthomason/packer.nvim'}
|
||||
|
||||
-- improved java syntax highlighting
|
||||
use {'uiiaoo/java-syntax.vim',
|
||||
@ -43,7 +37,11 @@ return require("packer").startup(function(use)
|
||||
requires = 'ryanoasis/vim-devicons'}
|
||||
|
||||
-- nim language support
|
||||
use {'zah/nim.vim', ft = {'nim'}}
|
||||
use {'zah/nim.vim',
|
||||
ft = {'nim'}}
|
||||
|
||||
-- automatic closing of brackets
|
||||
use {'windwp/nvim-autopairs'}
|
||||
|
||||
-- autocompletion and its sources
|
||||
use {'hrsh7th/nvim-cmp',
|
||||
@ -53,23 +51,35 @@ return require("packer").startup(function(use)
|
||||
'l3mon4d3/luasnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'neovim/nvim-lspconfig',
|
||||
'onsails/lspkind-nvim'}}
|
||||
'onsails/lspkind-nvim',
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'jose-elias-alvarez/null-ls.nvim',
|
||||
'nvim-lua/plenary.nvim',
|
||||
'jayp0521/mason-null-ls.nvim'}}
|
||||
|
||||
-- showing color of hex values, etc
|
||||
use 'norcalli/nvim-colorizer.lua'
|
||||
use {'norcalli/nvim-colorizer.lua'}
|
||||
|
||||
-- better language highlighting by improved parsing
|
||||
use {'nvim-treesitter/nvim-treesitter'}
|
||||
|
||||
-- automatically close html-tags
|
||||
use {'windwp/nvim-ts-autotag',
|
||||
requires = {'nvim-treesitter/nvim-treesitter'}}
|
||||
|
||||
-- colorful brackets
|
||||
use 'luochen1990/rainbow'
|
||||
use {'luochen1990/rainbow'}
|
||||
|
||||
-- show tags
|
||||
use {'majutsushi/tagbar',
|
||||
cmd = 'TagbarToggle'}
|
||||
|
||||
-- git wrapper
|
||||
use 'tpope/vim-fugitive'
|
||||
use {'tpope/vim-fugitive'}
|
||||
|
||||
-- indicate git diff status of line
|
||||
use 'airblade/vim-gitgutter'
|
||||
use {'airblade/vim-gitgutter'}
|
||||
|
||||
-- golang language support
|
||||
use {'fatih/vim-go',
|
||||
@ -81,12 +91,17 @@ return require("packer").startup(function(use)
|
||||
requires = {'godlygeek/tabular'}}
|
||||
|
||||
-- bulk renamer
|
||||
use 'qpkorr/vim-renamer'
|
||||
use {'qpkorr/vim-renamer'}
|
||||
|
||||
-- additional quote/parantheses funtions
|
||||
use 'tpope/vim-surround'
|
||||
use {'tpope/vim-surround'}
|
||||
|
||||
-- colorscheme
|
||||
use 'tiyn/vim-tccs'
|
||||
use {'tiyn/vim-tccs'}
|
||||
|
||||
-- package manager sync (last entry)
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
|
||||
end)
|
||||
|
1
.config/nvim/plugin/nvim-autopairs.lua
Normal file
1
.config/nvim/plugin/nvim-autopairs.lua
Normal file
@ -0,0 +1 @@
|
||||
require("nvim-autopairs").setup {}
|
@ -1,4 +1,26 @@
|
||||
-- hrsh7th/nvim-cmp
|
||||
|
||||
-- mason package manager
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
-- automatically install language servers setup below for lspconfig
|
||||
automatic_setup = true,
|
||||
})
|
||||
|
||||
-- jose-elias-alvarez/null-ls.nvim
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.autopep8,
|
||||
null_ls.builtins.formatting.nimpretty,
|
||||
},
|
||||
})
|
||||
|
||||
require("mason-null-ls").setup({
|
||||
automatic_installation = true
|
||||
})
|
||||
|
||||
-- Add additional capabilities supported by nvim-cmp
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
@ -94,7 +116,7 @@ local nvim_lsp = require('lspconfig')
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
local servers = { "pyright", "bashls", "tsserver", "texlab", "ccls", "gopls", "hls", "nimls", "marksman" }
|
||||
local servers = { "pyright", "bashls", "texlab", "ccls", "nimls", "marksman" }
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach=on_attach,
|
||||
|
19
.config/nvim/plugin/nvim-treesitter.lua
Normal file
19
.config/nvim/plugin/nvim-treesitter.lua
Normal file
@ -0,0 +1,19 @@
|
||||
-- nvim-treesitter/nvim-treesitter
|
||||
|
||||
local ts_config = require "nvim-treesitter.configs"
|
||||
|
||||
ts_config.setup {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"cpp",
|
||||
"css",
|
||||
"html",
|
||||
"java",
|
||||
"markdown",
|
||||
"latex",
|
||||
"python",
|
||||
},
|
||||
|
||||
autotag = { enable = true },
|
||||
}
|
@ -1,23 +1,37 @@
|
||||
super + Return
|
||||
$TERMINAL
|
||||
super + b
|
||||
$BROWSER
|
||||
super + f
|
||||
$TERMINAL -e $FILE
|
||||
super + u
|
||||
record_start
|
||||
super + i
|
||||
record_stop
|
||||
super + m
|
||||
thunderbird
|
||||
super + o
|
||||
record_replay_start
|
||||
super + p
|
||||
record_replay_save
|
||||
super + u
|
||||
record_start
|
||||
super + shift + x
|
||||
pkill -usr1 -x sxhkd; notify-send 'sxhkd' 'Reloaded config'
|
||||
|
||||
super + a
|
||||
playerctl previous
|
||||
super + s
|
||||
playerctl play-pause
|
||||
super + d
|
||||
playerctl next
|
||||
super + f
|
||||
$TERMINAL -e $FILE
|
||||
|
||||
super + b
|
||||
$BROWSER
|
||||
super + m
|
||||
thunderbird
|
||||
|
||||
super + shift + r
|
||||
dmenu_run -c -l 20
|
||||
|
||||
super + shift + x
|
||||
pkill -usr1 -x sxhkd; notify-send 'sxhkd' 'Reloaded config'
|
||||
|
||||
super + Return
|
||||
$TERMINAL
|
||||
super + Print
|
||||
maimpick
|
||||
|
||||
super + F5
|
||||
togglemonitor
|
||||
super + F6
|
||||
@ -34,8 +48,6 @@ super + F11
|
||||
prompt "Shutdown computer?" "sudo -A shutdown -h now"
|
||||
super + F12
|
||||
prompt "Reboot computer?" "sudo -A reboot now"
|
||||
super + Print
|
||||
maimpick
|
||||
|
||||
XF86AudioMute
|
||||
lmc m && pkill -RTMIN+4 $STATUSBAR
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
window=$(xdotool getwindowfocus)
|
||||
fps=30
|
||||
fps=60
|
||||
audio="$(pactl get-default-sink).monitor"
|
||||
format="mp4"
|
||||
lenght=20
|
||||
|
Loading…
x
Reference in New Issue
Block a user