Compare commits

...

10 commits

Author SHA1 Message Date
nold c29c5325b3 bashrc history stuff 2024-01-04 16:28:24 +01:00
Gerrit Pannek c12b43a795 fix(nvim): init lua autocmd 2023-03-15 13:16:16 +01:00
Gerrit Pannek a8f1f6e8f7 change(nvim): changed config for nvchad v2.0 2023-03-15 13:08:30 +01:00
nold d832c29659 fix(bashrc): powerline & python 3.10+ 2023-01-30 12:01:58 +01:00
nold ad61505f2c add(alias): winekiller 2022-12-27 12:01:40 +01:00
Gerrit Pannek 2e70d62e65 feat(nvim): README 2022-12-23 09:40:35 +01:00
Gerrit Pannek fb2b1e6d0e feat(setup): install treesitter parser 2022-12-22 11:27:08 +01:00
Gerrit Pannek d011b26db9 fix(tmux): RGB Color 2022-12-22 11:18:53 +01:00
Gerrit Pannek 252b9cbbbf fix(bashrc) 2022-12-22 11:18:25 +01:00
Gerrit Pannek bcdd436adc fix(nvchad) 2022-12-22 11:18:05 +01:00
13 changed files with 243 additions and 86 deletions

View file

@ -1,37 +1,65 @@
# Home Directory Configuration
This is my personal linux home directory configuration.
# home directory configuration
this is my personal linux home directory configuration.
Use at your own risk!
use at your own risk!
## Quickstart
## quickstart
Setting up this configuration is as simple as it gets:
setting up this configuration is as simple as it gets:
``` bash
git clone https://git.nold.in/nold/dotfiles
cd dotfiles && bash setup.sh
```
To Update everything just run `setup.sh` again.
to update everything just run `setup.sh` again.
## Structure
## structure
### bashrc
... well ... `~/.bashrc`... will not be linked unlike files contained in `dotfiles` directory, but `source`d. Leaving the local `~/.bashrc` intact.
... well ... `~/.bashrc`... will not be linked unlike files contained in `dotfiles` directory, but `source`d. leaving the local `~/.bashrc` intact.
### config
Directories the will be linked to `~/.config/${name}`.
directories the will be linked to `~/.config/${name}`.
### configfile
Only files from this directory tree will be linked, to the same directory under `~/.config`
only files from this directory tree will be linked, to the same directory under `~/.config`
### dotfiles
Files that are directly located under `$HOME`.
files that are directly located under `$home`.
### fonts
Fonts that will be copied to `~/.fonts`
fonts that will be copied to `~/.fonts`
### hosts
Custom additions to bashrc for specific hostnames. If no specific host is found in `hosts/$(hostname -s)`, `any` will be used.
custom additions to bashrc for specific hostnames. if no specific host is found in `hosts/$(hostname -s)`, `any` will be used.
### requirements.txt
Python libs to install using `pip3`.
python libs to install using `pip3`.
## neovim
### help
`<space + ?|tk>` - teleskope keymappings
### navigation
`<ctrl+n>` - toggle nvtree
### editing
`<space + />`- toggle comment_
### tabs
`<tab>` - next tab
`<shift+tab>` - prev tab_
### terminal
`<alt+h>` - horizontal terminal
`<alt+v>` - vertical terminal
### system
`<Space + uu>` - Update NvChad

29
bashrc
View file

@ -1,6 +1,10 @@
source /etc/profile 2>/dev/null
source /etc/profile.d/* 2>/dev/null
if [ -e /usr/bin/gnome-keyring-daemon ] ; then
source <(/usr/bin/gnome-keyring-daemon --start --components=ssh)
fi
# Change prompt if root
if [ $UID -eq 0 ] ; then
PROMPT_SUFFIX='\[\033[1;31m\] # \[\033[0m\]'
@ -22,10 +26,10 @@ function tmux_title {
}
#tmux_title $(hostname -s)
if [ -f ~/git/homedir-config/hosts/$(hostname -s)/bashrc ] ; then
source ~/git/homedir-config/hosts/$(hostname -s)/bashrc
if [ -f ~/git/dotfiles/hosts/$(hostname -s)/bashrc ] ; then
source ~/git/dotfiles/hosts/$(hostname -s)/bashrc
else
source ~/git/homedir-config/hosts/any/bashrc
source ~/git/dotfiles/hosts/any/bashrc
fi
if type nvim &>/dev/null ; then
@ -41,6 +45,24 @@ export LESS='-R'
export TERM=xterm-256color
export MC_SKIN=$HOME/.mc/lib/solarized.ini
# Better History
export HISTFILE=~/.bash_history
export HISTSIZE=10000000
export HISTFILESIZE=10000000
export HISTTIMEFORMAT="%F %T "
export HISTCONTROL='ignorespace:ignoredups'
export HISTIGNORE='l:ls:history'
# Don't render ![0-9] as previous command
set +o histexpand
# append to history, don't overwrite it
shopt -s histappend
# attempt to save all lines of a multiple-line command in the same history entry
shopt -s cmdhist
# save multi-line commands to the history with embedded newlines
shopt -s lithist
#if [ -e ~/.local/bin/virtualenvwrapper.sh ] ; then
# # Python stuff
# export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
@ -58,6 +80,7 @@ function json2yaml {
alias ls="ls --color=always --time-style=long-iso -F"
alias dfh="df -hT -t ext4 -t zfs -t xfs"
alias lsof='lsof 2>/dev/null | grep'
alias winekiller="ps -ef | grep 'fusion|wine|\.exe' -E -i | awk '{ print \$2}' | xargs kill -9"
# Git
alias gs="git status"

View file

@ -1,51 +1,17 @@
-- IMPORTANT NOTE : This is the user config, can be edited. Will be preserved if updated with internal updater
-- This file is for NvChad options & tools, custom settings are split between here and 'lua/custom/init.lua'
-- ChadRC.lua
local M = {}
local userPlugins = require "custom.plugins"
M.options = {
-- relativenumber = true,
smarttab = true
}
-- M.options = {
-- relativenumber = true,
-- smarttab = true
-- }
M.ui = {
theme = "tokyonight"
theme = "tokyonight"
}
-- NvChad included plugin options & overrides
M.plugins = {
options = {
statusline = {
separator_style = "slant",
}
-- lspconfig = {
-- path of file containing setups of different lsps (ex : "custom.plugins.lspconfig"), read the docs for more info
-- setup_lspconf = "",
-- },
},
-- To change the Packer `config` of a plugin that comes with NvChad,
-- add a table entry below matching the plugin github name
-- '-' -> '_', remove any '.lua', '.nvim' extensions
-- this string will be called in a `require`
-- use "(custom.configs).my_func()" to call a function
-- use "custom.blankline" to call a file
--default_plugin_config_replace = {},
override = {},
remove = {},
user = userPlugins,
}
M.mappings = {
-- custom = {}, -- custom user mappings
custom = {
cheatsheet = "<leader>ch",
line_number_toggle = "<leader>n", -- toggle line number
update_nvchad = "<leader>uu",
new_tab = "<leader>t",
},
}
M.plugins = "custom.plugins"
M.mappings = require "custom.mappings"
return M

View file

@ -0,0 +1,17 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
-- if you just want default config for the servers then put them in a table
local servers = { "ansiblels", "bashls", "pylsp", "yamlls", "marksman", "terraform_lsp", "jsonls" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
end
--
-- lspconfig.pyright.setup { blabla}

View file

@ -0,0 +1,25 @@
local present, null_ls = pcall(require, "null-ls")
if not present then
return
end
local b = null_ls.builtins
local sources = {
-- webdev stuff
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
b.formatting.prettier.with { filetypes = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes
-- Lua
b.formatting.stylua,
-- cpp
b.formatting.clang_format,
}
null_ls.setup {
debug = true,
sources = sources,
}

View file

@ -0,0 +1,77 @@
local M = {}
M.treesitter = {
ensure_installed = {
"diff",
"gitcommit",
"git_rebase",
"yaml",
"toml",
"dockerfile",
"python",
"go",
"php",
"make",
"jq",
"bash",
"json5",
"vim",
"lua",
"html",
"css",
"javascript",
"c",
"markdown",
"markdown_inline",
},
indent = {
enable = true,
disable = {
"python"
},
},
}
M.mason = {
ensure_installed = {
-- LSP:
"yaml-language-server",
"python-lsp-server",
"lua-language-server",
"bash-language-server",
"ansible-language-server",
"dockerfile-language-server",
"json-lsp",
"marksman",
"terraform-ls",
-- Formater:
"yamlfmt",
"shfmt",
"fixjson",
-- Linter:
"gitlint",
"yamllint",
"prettier",
"markdownlint",
},
}
-- git support in nvimtree
M.nvimtree = {
git = {
enable = true,
},
renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}
return M

View file

@ -1,8 +1,8 @@
-- AutoCMD:
--vim.cmd([[
-- vim.cmd([[
-- stuff
-- stuff
--]])
-- ]])
-- Open a file from its last left off position
vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
@ -12,4 +12,3 @@ vim.cmd [[ autocmd BufEnter * if &buftype != "terminal" | lcd %:p:h | endif ]]
-- File extension specific tabbing
vim.cmd [[ autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 ]]

View file

@ -0,0 +1,12 @@
---@type MappingsTable
local M = {}
M.general = {
n = {
[";"] = { ":", "enter command mode", opts = { nowait = true } },
},
}
-- more keybinds!
return M

View file

@ -0,0 +1,28 @@
local overrides = require("custom.configs.overrides")
---@type NvPluginSpec[]
local plugins = {
{
"neovim/nvim-lspconfig",
dependencies = {
-- format & linting
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require "custom.configs.null-ls"
end,
},
},
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end, -- Override to setup mason-lspconfig
},
-- overrde plugin configs
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
},
}
return plugins

View file

@ -1,21 +0,0 @@
-- Additional Plugins
--
return {
['cappyzawa/trim.nvim'] = {
config = function()
require('trim').setup({
-- if you want to ignore markdown file.
-- you can specify filetypes.
disable = {"markdown"},
-- if you want to ignore space of top
patterns = {
[[%s/\s\+$//e]], -- remove unwanted spaces
[[%s/\($\n\s*\)\+\%$//]], -- trim last line
[[%s/\%^\n\+//]], -- trim first line
-- [[%s/\(\n\n\)\n\+/\1/]], -- replace multiple blank lines with a single line
},
})
end
}
}

View file

@ -6,6 +6,7 @@ bind C-a send-prefix
## Default is 'screen'
set -sg default-terminal 'xterm-256color'
set-option -a terminal-overrides ",*256col*:RGB"
set -sg escape-time 1
set -sg set-clipboard on
set -g history-limit 100000

View file

@ -5,7 +5,7 @@ if which powerline-daemon &>/dev/null; then
POWERLINE_BASH_SELECT=1
fi
PYVERSION=$(python3 --version | grep -Eo '[0-9]\.[0-9]')
PYVERSION=$(python3 --version | grep -Eo '[0-9]\.[0-9]+')
if [ -f $HOME/.venv/lib/python${PYVERSION}/site-packages/powerline/bindings/bash/powerline.sh ]; then
export VIRTUAL_ENV="$HOME/.venv"
export PATH=$VIRTUAL_ENV/bin:$PATH
@ -33,4 +33,6 @@ elif [ -f ~/.local/lib/python${PYVERSION}/site-packages/powerline/bindings/bash/
source ~/.local/lib/python${PYVERSION}/site-packages/powerline/bindings/bash/powerline.sh
elif [ -f /usr/local/lib/python${PYVERSION}/dist-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/local/lib/python${PYVERSION}/dist-packages/powerline/bindings/bash/powerline.sh
elif [ -f /usr/share/powerline/bindings/bash/powerline.sh ] ; then
source /usr/share/powerline/bindings/bash/powerline.sh
fi

View file

@ -66,7 +66,7 @@ linkfiles 'dotfiles/*'
# NeoVIM & NvChad
git-sync https://github.com/NvChad/NvChad ~/.config/nvim
nvim +'hi NormalFloat guibg=#1e222a' +PackerSync
nvim +'hi NormalFloat guibg=#1e222a' +PackerSync +':TSInstall diff lua markdown cpp gitcommit git_rebase yaml toml dockerfile python go php make jq bash vim json5'
# Link Config Directories
linkfiles 'config/*'