Compare commits
10 commits
680f77e31c
...
c29c5325b3
Author | SHA1 | Date | |
---|---|---|---|
c29c5325b3 | |||
|
c12b43a795 | ||
|
a8f1f6e8f7 | ||
d832c29659 | |||
ad61505f2c | |||
|
2e70d62e65 | ||
|
fb2b1e6d0e | ||
|
d011b26db9 | ||
|
252b9cbbbf | ||
|
bcdd436adc |
13 changed files with 243 additions and 86 deletions
56
README.md
56
README.md
|
@ -1,37 +1,65 @@
|
||||||
# Home Directory Configuration
|
# home directory configuration
|
||||||
This is my personal linux 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
|
``` bash
|
||||||
git clone https://git.nold.in/nold/dotfiles
|
git clone https://git.nold.in/nold/dotfiles
|
||||||
cd dotfiles && bash setup.sh
|
cd dotfiles && bash setup.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
To Update everything just run `setup.sh` again.
|
to update everything just run `setup.sh` again.
|
||||||
|
|
||||||
## Structure
|
## structure
|
||||||
|
|
||||||
### bashrc
|
### 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
|
### config
|
||||||
Directories the will be linked to `~/.config/${name}`.
|
directories the will be linked to `~/.config/${name}`.
|
||||||
|
|
||||||
### configfile
|
### 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
|
### dotfiles
|
||||||
Files that are directly located under `$HOME`.
|
files that are directly located under `$home`.
|
||||||
|
|
||||||
### fonts
|
### fonts
|
||||||
Fonts that will be copied to `~/.fonts`
|
fonts that will be copied to `~/.fonts`
|
||||||
|
|
||||||
### hosts
|
### 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
|
### 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
29
bashrc
|
@ -1,6 +1,10 @@
|
||||||
source /etc/profile 2>/dev/null
|
source /etc/profile 2>/dev/null
|
||||||
source /etc/profile.d/* 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
|
# Change prompt if root
|
||||||
if [ $UID -eq 0 ] ; then
|
if [ $UID -eq 0 ] ; then
|
||||||
PROMPT_SUFFIX='\[\033[1;31m\] # \[\033[0m\]'
|
PROMPT_SUFFIX='\[\033[1;31m\] # \[\033[0m\]'
|
||||||
|
@ -22,10 +26,10 @@ function tmux_title {
|
||||||
}
|
}
|
||||||
#tmux_title $(hostname -s)
|
#tmux_title $(hostname -s)
|
||||||
|
|
||||||
if [ -f ~/git/homedir-config/hosts/$(hostname -s)/bashrc ] ; then
|
if [ -f ~/git/dotfiles/hosts/$(hostname -s)/bashrc ] ; then
|
||||||
source ~/git/homedir-config/hosts/$(hostname -s)/bashrc
|
source ~/git/dotfiles/hosts/$(hostname -s)/bashrc
|
||||||
else
|
else
|
||||||
source ~/git/homedir-config/hosts/any/bashrc
|
source ~/git/dotfiles/hosts/any/bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if type nvim &>/dev/null ; then
|
if type nvim &>/dev/null ; then
|
||||||
|
@ -41,6 +45,24 @@ export LESS='-R'
|
||||||
export TERM=xterm-256color
|
export TERM=xterm-256color
|
||||||
export MC_SKIN=$HOME/.mc/lib/solarized.ini
|
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
|
#if [ -e ~/.local/bin/virtualenvwrapper.sh ] ; then
|
||||||
# # Python stuff
|
# # Python stuff
|
||||||
# export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
|
# export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
|
||||||
|
@ -58,6 +80,7 @@ function json2yaml {
|
||||||
alias ls="ls --color=always --time-style=long-iso -F"
|
alias ls="ls --color=always --time-style=long-iso -F"
|
||||||
alias dfh="df -hT -t ext4 -t zfs -t xfs"
|
alias dfh="df -hT -t ext4 -t zfs -t xfs"
|
||||||
alias lsof='lsof 2>/dev/null | grep'
|
alias lsof='lsof 2>/dev/null | grep'
|
||||||
|
alias winekiller="ps -ef | grep 'fusion|wine|\.exe' -E -i | awk '{ print \$2}' | xargs kill -9"
|
||||||
|
|
||||||
# Git
|
# Git
|
||||||
alias gs="git status"
|
alias gs="git status"
|
||||||
|
|
|
@ -1,51 +1,17 @@
|
||||||
-- IMPORTANT NOTE : This is the user config, can be edited. Will be preserved if updated with internal updater
|
-- ChadRC.lua
|
||||||
-- This file is for NvChad options & tools, custom settings are split between here and 'lua/custom/init.lua'
|
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
local userPlugins = require "custom.plugins"
|
|
||||||
|
|
||||||
M.options = {
|
-- M.options = {
|
||||||
-- relativenumber = true,
|
-- relativenumber = true,
|
||||||
smarttab = true
|
-- smarttab = true
|
||||||
}
|
-- }
|
||||||
|
|
||||||
M.ui = {
|
M.ui = {
|
||||||
theme = "tokyonight"
|
theme = "tokyonight"
|
||||||
}
|
}
|
||||||
|
|
||||||
-- NvChad included plugin options & overrides
|
M.plugins = "custom.plugins"
|
||||||
M.plugins = {
|
M.mappings = require "custom.mappings"
|
||||||
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",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
||||||
|
|
17
configfile/nvim/lua/custom/configs/lspconfig.lua
Normal file
17
configfile/nvim/lua/custom/configs/lspconfig.lua
Normal 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}
|
25
configfile/nvim/lua/custom/configs/null-ls.lua
Normal file
25
configfile/nvim/lua/custom/configs/null-ls.lua
Normal 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,
|
||||||
|
}
|
77
configfile/nvim/lua/custom/configs/overrides.lua
Normal file
77
configfile/nvim/lua/custom/configs/overrides.lua
Normal 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
|
|
@ -1,8 +1,8 @@
|
||||||
-- AutoCMD:
|
-- AutoCMD:
|
||||||
--vim.cmd([[
|
-- vim.cmd([[
|
||||||
-- stuff
|
-- stuff
|
||||||
-- stuff
|
-- stuff
|
||||||
--]])
|
-- ]])
|
||||||
|
|
||||||
-- Open a file from its last left off position
|
-- 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 ]]
|
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
|
-- File extension specific tabbing
|
||||||
vim.cmd [[ autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 ]]
|
vim.cmd [[ autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 ]]
|
||||||
|
|
||||||
|
|
12
configfile/nvim/lua/custom/mappings.lua
Normal file
12
configfile/nvim/lua/custom/mappings.lua
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
---@type MappingsTable
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.general = {
|
||||||
|
n = {
|
||||||
|
[";"] = { ":", "enter command mode", opts = { nowait = true } },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- more keybinds!
|
||||||
|
|
||||||
|
return M
|
28
configfile/nvim/lua/custom/plugins.lua
Normal file
28
configfile/nvim/lua/custom/plugins.lua
Normal 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
|
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,6 +6,7 @@ bind C-a send-prefix
|
||||||
|
|
||||||
## Default is 'screen'
|
## Default is 'screen'
|
||||||
set -sg default-terminal 'xterm-256color'
|
set -sg default-terminal 'xterm-256color'
|
||||||
|
set-option -a terminal-overrides ",*256col*:RGB"
|
||||||
set -sg escape-time 1
|
set -sg escape-time 1
|
||||||
set -sg set-clipboard on
|
set -sg set-clipboard on
|
||||||
set -g history-limit 100000
|
set -g history-limit 100000
|
||||||
|
|
|
@ -5,7 +5,7 @@ if which powerline-daemon &>/dev/null; then
|
||||||
POWERLINE_BASH_SELECT=1
|
POWERLINE_BASH_SELECT=1
|
||||||
fi
|
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
|
if [ -f $HOME/.venv/lib/python${PYVERSION}/site-packages/powerline/bindings/bash/powerline.sh ]; then
|
||||||
export VIRTUAL_ENV="$HOME/.venv"
|
export VIRTUAL_ENV="$HOME/.venv"
|
||||||
export PATH=$VIRTUAL_ENV/bin:$PATH
|
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
|
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
|
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
|
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
|
fi
|
||||||
|
|
2
setup.sh
2
setup.sh
|
@ -66,7 +66,7 @@ linkfiles 'dotfiles/*'
|
||||||
|
|
||||||
# NeoVIM & NvChad
|
# NeoVIM & NvChad
|
||||||
git-sync https://github.com/NvChad/NvChad ~/.config/nvim
|
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
|
# Link Config Directories
|
||||||
linkfiles 'config/*'
|
linkfiles 'config/*'
|
||||||
|
|
Loading…
Reference in a new issue