Skip to content

zkamvar/config-files

Repository files navigation

Zhian's Config Files (dotfiles)

To use these files, clone this repo into a place on your computer and then symlink them to your home directory. For example, here's how to link the bash prompt file:

ln -s path/to/config-files/.bash_prompt .bash_prompt

To use the .bash_ dotfiles in your .bashrc or .bash_profile, you can load them with:

if [ -f ${HOME}/.bash_prompt ]; then
  . ${HOME}/.bash_prompt
fi

neo vim

I started building the .vimrc file when I was using pure vim. At some point, I switched to NeoVim because there was a bug with certain characters that caused vim to crash (I cannot remember exactly why).

NeoVim uses an init file to start up (in ~/.config/nvim/), which can either be init.vim or init.lua written in vimscript or luascript, respectively. I used this to synchronize the plugins between vim and NeoVim, but had not migrated to using init.lua.

In 2024, the Nvim-R plugin has been superseded by R.nvim, and all the configuration instructions use lua script. I had attempted to switch over in early 2024, but I could not find the right tutorials for migrating over and ended up borking my nvim setup (but because I had this repo, I could easily go back).

In July 2024, I found a good walkthrough to convert vimrc to lua, which includes the inital steps of calling vimscript from lua and then the incremental process of conversion. What the author ended up with was a set of configurations for NeoVim controlled by ~/.config/nvim/init.lua and auxillary files and then a set of configurations for vim controlled by ~/.vimrc.

With this in mind, I have set up my vim to be very similar and have copied over the nvim configuration into the nvim/ folder and have symlinked that directory to ~/.config/nvim/.

.gitconfig

To use the .gitconfig in your own .gitconfig, use the [include] directive:

[user]
    name = "Your Name"
    email = "your.name@example.com"
    signingkey = "<your GPG or SSH signing key ID>"
[include]
    path = "/path/to/config-files/.gitconfig"
[commit]
    gpgSign = true
[tag]
    gpgSign = true

kitty

The kitty config is put in ~/.config/kitty/

Changing colors

I previously had some keyboard mappings to change colors in kitty, but it got more complicated with the themes kitten where it would modify the kitty/kitty.conf file to include the following lines:

# BEGIN_KITTY_THEME
# <theme name>
include current-theme.conf
# END_KITTY_THEME

Every time I changed the theme, my kitty conf would be changed in git's eyes. The way I rectified this was to use git filters which would act on the kitty/kitty.conf file by removing those lines alltogether:

BIG CAVEAT: This must be done on each computer separately. The git configuration is not replicated across computers.

In .git/config

[filter "badkitty"]
  clean=sed '/BEGIN_KITTY_THEME/,/END_KITTY_THEME/ d'
  smudge=sed '/BEGIN_KITTY_THEME/,/END_KITTY_THEME/ d'

In .git/info/attributes

kitty/kitty.conf filter=badkitty