Skip to content

Commit 67260c8

Browse files
committed
nvim
1 parent 64d3923 commit 67260c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1333
-14726
lines changed

.bashrc

+92-60
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ shopt -s checkwinsize
2525

2626
# set variable identifying the chroot you work in (used in the prompt below)
2727
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
28-
debian_chroot=$(cat /etc/debian_chroot)
28+
debian_chroot=$(cat /etc/debian_chroot)
2929
fi
3030

3131
# set a fancy prompt (non-color, unless we know we "want" color)
3232
case "$TERM" in
33-
xterm-color|rxvt-unicode) color_prompt=yes;;
33+
xterm-color | rxvt-unicode) color_prompt=yes ;;
3434
esac
3535

3636
# uncomment for a colored prompt, if the terminal has the capability; turned
@@ -39,42 +39,41 @@ esac
3939
#force_color_prompt=yes
4040

4141
if [ -n "$force_color_prompt" ]; then
42-
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
43-
# We have color support; assume it's compliant with Ecma-48
44-
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
45-
# a case would tend to support setf rather than setaf.)
46-
color_prompt=yes
47-
else
48-
color_prompt=
49-
fi
42+
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
43+
# We have color support; assume it's compliant with Ecma-48
44+
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
45+
# a case would tend to support setf rather than setaf.)
46+
color_prompt=yes
47+
else
48+
color_prompt=
49+
fi
5050
fi
5151

5252
if [ "$color_prompt" = yes ]; then
53-
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
53+
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
5454
else
55-
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
55+
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
5656
fi
5757
unset color_prompt force_color_prompt
5858

5959
# If this is an xterm set the title to user@host:dir
6060
case "$TERM" in
61-
xterm*|rxvt-unicode)
62-
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \W\a\]$PS1"
63-
;;
64-
*)
65-
;;
61+
xterm* | rxvt-unicode)
62+
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \W\a\]$PS1"
63+
;;
64+
*) ;;
6665
esac
6766

6867
# enable color support of ls and also add handy aliases
6968
if [ -x /usr/bin/dircolors ]; then
70-
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
71-
alias ls='ls --color=auto'
72-
#alias dir='dir --color=auto'
73-
#alias vdir='vdir --color=auto'
74-
75-
alias grep='grep --color=auto'
76-
alias fgrep='fgrep --color=auto'
77-
alias egrep='egrep --color=auto'
69+
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
70+
alias ls='ls --color=auto'
71+
#alias dir='dir --color=auto'
72+
#alias vdir='vdir --color=auto'
73+
74+
alias grep='grep --color=auto'
75+
alias fgrep='fgrep --color=auto'
76+
alias egrep='egrep --color=auto'
7877
fi
7978

8079
# some more ls aliases
@@ -92,14 +91,14 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo nfs || echo erro
9291
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
9392

9493
if [ -f ~/.bash_aliases ]; then
95-
. ~/.bash_aliases
94+
. ~/.bash_aliases
9695
fi
9796

9897
# enable programmable completion features (you don't need to enable
9998
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
10099
# sources /etc/bash.bashrc).
101100
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
102-
. /etc/bash_completion
101+
. /etc/bash_completion
103102
fi
104103

105104
# wrap_alias takes three arguments:
@@ -111,40 +110,40 @@ fi
111110
# completer for the command, and set the wrapper as the completer for
112111
# the alias.
113112
function wrap_alias() {
114-
[[ "$#" == 3 ]] || return 1
113+
[[ "$#" == 3 ]] || return 1
115114

116-
local alias_name="$1"
117-
local aliased_command="$2"
118-
local alias_arguments="$3"
119-
local num_alias_arguments=$(echo "$alias_arguments" | wc -w)
115+
local alias_name="$1"
116+
local aliased_command="$2"
117+
local alias_arguments="$3"
118+
local num_alias_arguments=$(echo "$alias_arguments" | wc -w)
120119

121-
# The completion currently being used for the aliased command.
122-
local completion=$(complete -p $aliased_command 2> /dev/null)
120+
# The completion currently being used for the aliased command.
121+
local completion=$(complete -p $aliased_command 2>/dev/null)
123122

124-
# Only a completer based on a function can be wrapped so look for -F
125-
# in the current completion. This check will also catch commands
126-
# with no completer for which $completion will be empty.
127-
echo $completion | grep -q -- -F || return 0
123+
# Only a completer based on a function can be wrapped so look for -F
124+
# in the current completion. This check will also catch commands
125+
# with no completer for which $completion will be empty.
126+
echo $completion | grep -q -- -F || return 0
128127

129-
local namespace=alias_completion::
128+
local namespace=alias_completion::
130129

131-
# Extract the name of the completion function from a string that
132-
# looks like: something -F function_name something
133-
# First strip the beginning of the string up to the function name by
134-
# removing "* -F " from the front.
135-
local completion_function=${completion##* -F }
136-
# Then strip " *" from the end, leaving only the function name.
137-
completion_function=${completion_function%% *}
130+
# Extract the name of the completion function from a string that
131+
# looks like: something -F function_name something
132+
# First strip the beginning of the string up to the function name by
133+
# removing "* -F " from the front.
134+
local completion_function=${completion##* -F }
135+
# Then strip " *" from the end, leaving only the function name.
136+
completion_function=${completion_function%% *}
138137

139-
# Try to prevent an infinite loop by not wrapping a function
140-
# generated by this function. This can happen when the user runs
141-
# this twice for an alias like ls='ls --color=auto' or alias l='ls'
142-
# and alias ls='l foo'
143-
[[ "${completion_function#$namespace}" != $completion_function ]] && return 0
138+
# Try to prevent an infinite loop by not wrapping a function
139+
# generated by this function. This can happen when the user runs
140+
# this twice for an alias like ls='ls --color=auto' or alias l='ls'
141+
# and alias ls='l foo'
142+
[[ "${completion_function#$namespace}" != $completion_function ]] && return 0
144143

145-
local wrapper_name="${namespace}${alias_name}"
144+
local wrapper_name="${namespace}${alias_name}"
146145

147-
eval "
146+
eval "
148147
function ${wrapper_name}() {
149148
let COMP_CWORD+=$num_alias_arguments
150149
args=( \"${alias_arguments}\" )
@@ -153,14 +152,14 @@ function ${wrapper_name}() {
153152
}
154153
"
155154

156-
# To create the new completion we use the old one with two
157-
# replacements:
158-
# 1) Replace the function with the wrapper.
159-
local new_completion=${completion/-F * /-F $wrapper_name }
160-
# 2) Replace the command being completed with the alias.
161-
new_completion="${new_completion% *} $alias_name"
155+
# To create the new completion we use the old one with two
156+
# replacements:
157+
# 1) Replace the function with the wrapper.
158+
local new_completion=${completion/-F * /-F $wrapper_name }
159+
# 2) Replace the command being completed with the alias.
160+
new_completion="${new_completion% *} $alias_name"
162161

163-
eval "$new_completion"
162+
eval "$new_completion"
164163
}
165164

166165
# For each defined alias, extract the necessary elements and use them
@@ -178,9 +177,42 @@ export PLATFORM='linux'
178177
export MANPAGER="/bin/sh -c \"col -b | vim -c 'set ft=man ts=8 nomod nolist nonu noma' -\""
179178
export COMMAND_NOT_FOUND_INSTALL_PROMPT=1
180179

180+
PATH=$PATH:/opt/homebrew/bin
181181
PATH=$PATH:~/.bin/
182182
GOPATH=~/Work/go
183183
PATH=$PATH:$GOPATH/bin
184184

185185
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
186186
[ -f ~/.fzf.colors ] && source ~/.fzf.colors
187+
188+
alias vi=nvim
189+
alias vim=nvim
190+
191+
export FZF_DEFAULT_OPTS="
192+
--border=double
193+
--layout=reverse-list
194+
--keep-right
195+
--border-label-pos=-3:bottom
196+
--scroll-off 3
197+
--prompt 'history ⟩ '
198+
--pointer '👉'
199+
--marker ''
200+
--no-bold
201+
--min-height=30
202+
--info inline
203+
--reverse
204+
--cycle
205+
"
206+
207+
[ -f ~/.fzf.colors ] && source ~/.fzf.colors
208+
209+
export FZF_CTRL_T_OPTS="--preview '(highlight -O ansi -l {} 2> /dev/null || cat {} || tree -C {}) 2> /dev/null | head -200'"
210+
export FZF_DEFAULT_COMMAND='fd --type f --strip-cwd-prefix --hidden --follow --exclude .git'
211+
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
212+
213+
[ -f ~/.zsh.fzf ] && . ~/.zsh.fzf
214+
[ -f ~/.fzf.docker ] && . ~/.fzf.docker
215+
216+
export FZF_COMPLETION_TRIGGER=','
217+
218+
source /Users/tuxcanfly/.config/broot/launcher/bash/br

.config/nvim

-1
This file was deleted.

.config/nvim/README.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# MVIM
2+
3+
This is my NeoVim Configuration based entirely on [mini.nvim](https://github.com/echasnovski/mini.nvim)
4+
5+
![Dashboard](mvim-dashboard.png)
6+
![Code](mvim.png)
7+
8+
## Why?
9+
Mostly because it's a single plugin with most functionality i need. So i can easily scp this to Servers without Internet Connection and still have my entire NeoVim Setup.
10+
Additionaly, I was getting tired of maintaining a Configuration with as many plugins as i did. I wanted to see what mini has to offer and it turned out it can basically replace all my other Plugins.
11+
12+
## Dependencies
13+
This configuration should mostly work on it's own without anything else. To get it you need git (obviously).
14+
I have provided a keymap for lazygit (`<leader>gg`), so you should install this if you want to use that.
15+
I'm not going to go over how to get the tools you need to install LSPs. Others have done that much better already.
16+
17+
## Things to configure
18+
Compared to nvim Distributions, this is mostly my personal Configuration as is. This also means that it contains some Settings, that probably don't work for you, or should be extended
19+
20+
### Hipatterns
21+
I use mini.hipatterns to hide Passwords from files. This helps when screensharing in Meetings. This is based on matching a regex before the password. Please look at the hipatterns configuration
22+
in my init.lua and add/remove patterns you don't need. Else this could lead to code being hidden.
23+
24+
### LSP Configuration
25+
I do provide a minimal LSP Setup. This is enough for my personal use but can be extended.
26+
The basic gist is, that you need to manually install your prefered LSPs through Mason and then add `require('lspconfig').yourlsp.setup {}` to init.lua
27+
I'll add a more detailed description later.
28+
29+
## Colorschemes
30+
Mini.nvim provides three different option to set up a colorscheme:
31+
- mini.colors
32+
- mini.hues
33+
- mini.base16
34+
Per default we use mini.base16 with our own colorscheme, inspired by the emacs modus themes by protesilaos.
35+
It should be noted though, that the dev of mini.base16 feels like it doesn't do highlighting as well as neovim could, as it closely follows the base16 specification. You can change the theme to randomhue
36+
or manually configure mini.hues for a more coherent look.
37+
38+
### mini.hues
39+
This creates a colorscheme based on a background and foreground color. Alternatively it provides a "randomhues" colorscheme that randomizes the look with each call.
40+
You can uncomment this in `init.lua`, if you want to use it.
41+
42+
### mini.base16
43+
Here we can provide a [base16](https://github.com/chriskempson/base16) theme. The 16 colors are provided through the "palette" array.
44+
You can uncomment this in `init.lua`, if you want to use it. It's set up with a basic `catppuccin` inspired Colorscheme.
45+
This is also used to provide the themes in the "colors/" folder. If you want more than one theme, you can copy one of those and insert your own colors. This is also the way to get dark/light mode of the same theme.
46+
47+
## How Sessions Work
48+
For now, you need to manualy create a Session first. So, launch MVIM, type `:lua MiniSessions.write('Sessionname')`
49+
After that you can start editing and using MVIM like you normaly would. On Quitting MVIM, the Session is saved. It'll show up on the Dashboard and you can get a Session selection with `<Leader>sf`.
50+
I plan on updating the keybinds to something that automatically infers the session name from cwd.
51+
52+
## Unique things
53+
Since this is my personal Configuration, there might be things that work differently from other distributions. I'm not going over keybinds mostly, as you can discover them through mini.clues (just press space, it shows up on the bottom right).
54+
I did, however, rebind the umlaut "ö" to colon in normal and visual mode. It's the same spot where colon would be on a QWERTY keyboard. I just use a QWERTZ layout.

.config/nvim/colors/catppuccin.lua

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
-- 'Minicyan' color scheme
2+
-- Derived from base16 (https://github.com/chriskempson/base16) and
3+
-- mini_palette palette generator
4+
local use_cterm, palette
5+
6+
-- Dark palette is an output of 'MiniBase16.mini_palette':
7+
-- - Background '#0A2A2A' (LCh(uv) = 15-10-192)
8+
-- - Foreground '#D0D0D0' (Lch(uv) = 83-0-0)
9+
-- - Accent chroma 50
10+
if vim.o.background == 'dark' then
11+
palette = {
12+
base00 = '#1e1e2e' ,
13+
base01 = '#181825' ,
14+
base02 = '#313244' ,
15+
base03 = '#45475a' ,
16+
base04 = '#585b70' ,
17+
base05 = '#cdd6f4' ,
18+
base06 = '#f5e0dc' ,
19+
base07 = '#b4befe' ,
20+
base08 = '#f38ba8' ,
21+
base09 = '#fab387' ,
22+
base0A = '#f9e2af' ,
23+
base0B = '#a6e3a1' ,
24+
base0C = '#94e2d5' ,
25+
base0D = '#89b4fa' ,
26+
base0E = '#cba6f7' ,
27+
base0F = '#f2cdcd'
28+
}
29+
use_cterm = {
30+
base00 = 235,
31+
base01 = 238,
32+
base02 = 241,
33+
base03 = 102,
34+
base04 = 250,
35+
base05 = 252,
36+
base06 = 254,
37+
base07 = 231,
38+
base08 = 186,
39+
base09 = 136,
40+
base0A = 29,
41+
base0B = 115,
42+
base0C = 132,
43+
base0D = 153,
44+
base0E = 218,
45+
base0F = 67,
46+
}
47+
end
48+
49+
-- Light palette is an 'inverted dark', output of 'MiniBase16.mini_palette':
50+
-- - Background '#C0D2D2' (LCh(uv) = 83-10-192)
51+
-- - Foreground '#262626' (Lch(uv) = 15-0-0)
52+
-- - Accent chroma 80
53+
if vim.o.background == 'light' then
54+
palette = {
55+
base00 = "#fbf1c7",
56+
base01 = "#f2e5bc",
57+
base02 = "#d5c4a1",
58+
base03 = "#bdae93",
59+
base04 = "#665c54",
60+
base05 = "#654735",
61+
base06 = "#3c3836",
62+
base07 = "#282828",
63+
base08 = "#c14a4a",
64+
base09 = "#c35e0a",
65+
base0A = "#b47109",
66+
base0B = "#6c782e",
67+
base0C = "#4c7a5d",
68+
base0D = "#45707a",
69+
base0E = "#945e80",
70+
base0F = "#e78a4e",
71+
}
72+
use_cterm = {
73+
base00 = 252,
74+
base01 = 248,
75+
base02 = 102,
76+
base03 = 241,
77+
base04 = 237,
78+
base05 = 235,
79+
base06 = 234,
80+
base07 = 232,
81+
base08 = 235,
82+
base09 = 94,
83+
base0A = 29,
84+
base0B = 22,
85+
base0C = 126,
86+
base0D = 25,
87+
base0E = 89,
88+
base0F = 25,
89+
}
90+
end
91+
92+
if palette then
93+
require('mini.base16').setup({ palette = palette, use_cterm = use_cterm })
94+
vim.g.colors_name = 'catppuccin'
95+
end

0 commit comments

Comments
 (0)