Compare commits
9 Commits
5b30acf596
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 5691bd9fdc | |||
| 27c2569984 | |||
| c828dfc2e6 | |||
| feb789c989 | |||
| 67ffb18e03 | |||
| 019e8708d3 | |||
| ee10125402 | |||
| 19857722b4 | |||
| 00c1b647ea |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
fish/fish_variables
|
||||
fish/local.fish
|
||||
fish/*
|
||||
!fish/config.fish
|
||||
!fish/functions/*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# The MIT License (MIT)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
HASH="%C(yellow)%h%C(reset)"
|
||||
RELATIVE_TIME="%C(green)%ar%C(reset)"
|
||||
|
||||
28
capslock.ahk
Executable file
28
capslock.ahk
Executable file
@@ -0,0 +1,28 @@
|
||||
#Requires AutoHotkey v2.0
|
||||
|
||||
SetCapsLockState "AlwaysOff"
|
||||
|
||||
Capslock::
|
||||
{
|
||||
Send "{LControl Down}"
|
||||
KeyWait("CapsLock")
|
||||
Send "{LControl Up}"
|
||||
if ( A_PriorKey = "CapsLock" )
|
||||
{
|
||||
Send "{Esc}"
|
||||
}
|
||||
SetCapsLockState("Off")
|
||||
}
|
||||
|
||||
|
||||
::..date::
|
||||
{
|
||||
Send A_YYYY "-" A_MM "-" A_DD
|
||||
Send A_EndChar
|
||||
}
|
||||
|
||||
::..time::
|
||||
{
|
||||
Send A_Hour ":" A_Min
|
||||
Send A_EndChar
|
||||
}
|
||||
@@ -21,14 +21,11 @@ if type -q pyenv
|
||||
end
|
||||
# pyenv virtualenv-init - | source
|
||||
|
||||
alias dc="docker-compose"
|
||||
alias dce="docker-compose exec"
|
||||
alias dc="docker compose"
|
||||
alias dce="docker compose exec"
|
||||
alias drh="docker run -it --rm -v (pwd):/usr/(pwd) -w /usr/(pwd)"
|
||||
|
||||
|
||||
fish_vi_key_bindings
|
||||
|
||||
|
||||
# Include local config if present
|
||||
|
||||
if test -r $DOTFILES/fish/local.fish
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
function fish_right_prompt
|
||||
set -l ref (git symbolic-ref HEAD ^/dev/null)
|
||||
set -l ref (git symbolic-ref HEAD 2>/dev/null)
|
||||
if test -z $ref
|
||||
return
|
||||
end
|
||||
|
||||
git diff --no-ext-diff --quiet --exit-code ^/dev/null
|
||||
git diff --no-ext-diff --quiet --exit-code 2>/dev/null
|
||||
or set -l dirty 'yes'
|
||||
|
||||
git diff-index --cached --quiet HEAD -- ^/dev/null
|
||||
git diff-index --cached --quiet HEAD -- 2>/dev/null
|
||||
or set -l staged 'yes'
|
||||
|
||||
set_color normal
|
||||
|
||||
4
init.vim
4
init.vim
@@ -36,6 +36,8 @@ xmap Å [
|
||||
xmap å ]
|
||||
noremap ÅÅ [[
|
||||
noremap åå ]]
|
||||
nnoremap <space>, <c-^>
|
||||
nnoremap <tab> %
|
||||
|
||||
" Some searching options
|
||||
set ignorecase
|
||||
@@ -52,3 +54,5 @@ set hidden
|
||||
|
||||
" Uppercase last word on c-^
|
||||
inoremap <C-]> <Esc>gUiw`]a
|
||||
|
||||
nnoremap <silent> § :NERDTreeToggle<CR>
|
||||
|
||||
81
install.sh
81
install.sh
@@ -1,44 +1,69 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function install_dependencies() {
|
||||
function install_pkg() {
|
||||
if hash apt-get 2>/dev/null; then
|
||||
sudo -n apt-get update
|
||||
sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
fish \
|
||||
neovim \
|
||||
tmux
|
||||
sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ${@}
|
||||
return
|
||||
fi
|
||||
|
||||
if hash nix 2>/dev/null; then
|
||||
echo "INSTALL ${@} yourself with nix"
|
||||
return
|
||||
fi
|
||||
}
|
||||
|
||||
function setup_ssh() {
|
||||
configfile=~/.ssh/config
|
||||
if grep -Fxq "# dotfiles installed" ${configfile}; then
|
||||
return
|
||||
fi
|
||||
|
||||
mkdir -p ~/.ssh
|
||||
touch ~/.ssh/config
|
||||
chmod 644 ~/.ssh/config
|
||||
cat << EOF >> ~/.ssh/config
|
||||
touch ${configfile}
|
||||
chmod 644 ${configfile}
|
||||
cat << EOF >> ${configfile}
|
||||
Include ${HOME}/dotfiles/ssh.config
|
||||
# dotfiles installed
|
||||
EOF
|
||||
}
|
||||
|
||||
function setup_git() {
|
||||
cat << EOF > ~/.gitconfig
|
||||
configfile=~/.gitconfig
|
||||
if grep -Fxq "# dotfiles installed" ${configfile}; then
|
||||
return
|
||||
fi
|
||||
|
||||
cat << EOF > ${configfile}
|
||||
[include]
|
||||
path = ${HOME}/dotfiles/git/gitconfig
|
||||
[core]
|
||||
excludesfile = ${HOME}/dotfiles/git/gitignore_global
|
||||
# dotfiles installed
|
||||
EOF
|
||||
|
||||
setup_ssh
|
||||
}
|
||||
|
||||
function setup_tmux() {
|
||||
cat << EOF > ~/.tmux.conf
|
||||
configfile=~/.tmux.conf
|
||||
if grep -Fxq "# dotfiles installed" ${configfile}; then
|
||||
return
|
||||
fi
|
||||
|
||||
install_pkg tmux
|
||||
cat << EOF > ${configfile}
|
||||
source ${HOME}/dotfiles/tmux/tmux.conf
|
||||
# dotfiles.installed
|
||||
EOF
|
||||
}
|
||||
|
||||
function setup_fish() {
|
||||
install_pkg fish
|
||||
|
||||
USER=`whoami`
|
||||
sudo -n chsh $USER -s $(which fish)
|
||||
# Force fish shell for devcontainers
|
||||
echo "exec $(which fish) -l" >> ~/.profile
|
||||
echo "exec $(which fish) -l" >> ~/.bashrc
|
||||
echo "exec $(which fish) -l" >> ~/.zshrc
|
||||
|
||||
@@ -47,29 +72,41 @@ function setup_fish() {
|
||||
}
|
||||
|
||||
function setup_nvim() {
|
||||
install_pkg neovim
|
||||
mkdir -p ~/.config/nvim/
|
||||
ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim
|
||||
|
||||
# Install NERDtree plugin
|
||||
git clone --single-branch https://github.com/preservim/nerdtree.git ~/.config/nvim/pack/vendor/start/nerdtree
|
||||
git clone --single-branch https://tpope.io/vim/commentary.git ~/.config/nvim/pack/vendor/start/commentary
|
||||
nvim -u NONE -c "helptags ~/.config/nvim/pack/vendor/start/nerdtree/doc" -c q
|
||||
nvim -u NONE -c "helptags ~/.config/nvim/pack/vendor/start/commentary/doc" -c q
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
||||
install_pkg locales less
|
||||
|
||||
if [[ ${REMOTE_CONTAINERS} || ${DEVCONTAINER} ]]; then
|
||||
echo "sv_SE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
|
||||
sudo locale-gen
|
||||
fi
|
||||
|
||||
setup_fish
|
||||
setup_ssh
|
||||
setup_git
|
||||
|
||||
if [[ ${REMOTE_CONTAINERS} || ${DEVCONTAINER} ]]; then
|
||||
|
||||
echo "INSTALLING IN DEVCONTAINER"
|
||||
|
||||
fi
|
||||
echo "set -x EDITOR code" >> ~/.config/fish/local.fish
|
||||
|
||||
install_dependencies
|
||||
|
||||
|
||||
echo "sv_SE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
|
||||
sudo locale-gen
|
||||
|
||||
setup_fish
|
||||
setup_ssh
|
||||
setup_git
|
||||
else
|
||||
setup_tmux
|
||||
setup_nvim
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
main $@
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
|
||||
13
vscode_settings.json
Normal file
13
vscode_settings.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"dev.containers.defaultExtensions": [
|
||||
"spmeesseman.vscode-taskexplorer",
|
||||
"github.vscode-pull-request-github"
|
||||
],
|
||||
"dotfiles.repository": "https://git.thomasloven.com/thomas/vsc-dotfiles.git",
|
||||
"projectManager.tags": ["Personal", "Work", "cade", "hass"],
|
||||
"diffEditor.ignoreTrimWhitespace": false,
|
||||
"editor.formatOnSave": true,
|
||||
"chat.agent.enabled": false,
|
||||
"telemetry.feedback.enabled": false,
|
||||
"telemetry.editStats.enabled": false
|
||||
}
|
||||
Reference in New Issue
Block a user