Compare commits
6 Commits
311d6a678b
...
5b30acf596
Author | SHA1 | Date | |
---|---|---|---|
5b30acf596 | |||
5f61d1d4cd | |||
9c8892559d | |||
4e1ac03bfe | |||
497f1b1fa6 | |||
2d63016f8a |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
fish/fish_variables
|
||||||
|
fish/local.fish
|
@ -2,7 +2,9 @@ set -x DOTFILES $HOME/dotfiles
|
|||||||
|
|
||||||
if test -z "$FISH_SETUP_PATH"
|
if test -z "$FISH_SETUP_PATH"
|
||||||
set -xp PATH $HOME/.pyenv/bin
|
set -xp PATH $HOME/.pyenv/bin
|
||||||
|
set -xp PATH $HOME/.local/bin
|
||||||
set -xp PATH $HOME/dotfiles/bin
|
set -xp PATH $HOME/dotfiles/bin
|
||||||
|
set -xp PATH $HOME/bin
|
||||||
set -xp PATH .
|
set -xp PATH .
|
||||||
|
|
||||||
set -x FISH_SETUP_PATH
|
set -x FISH_SETUP_PATH
|
||||||
@ -20,4 +22,16 @@ end
|
|||||||
# pyenv virtualenv-init - | source
|
# pyenv virtualenv-init - | source
|
||||||
|
|
||||||
alias dc="docker-compose"
|
alias dc="docker-compose"
|
||||||
|
alias dce="docker-compose exec"
|
||||||
alias drh="docker run -it --rm -v (pwd):/usr/(pwd) -w /usr/(pwd)"
|
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
|
||||||
|
source $DOTFILES/fish/local.fish
|
||||||
|
end
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
[user]
|
[user]
|
||||||
name = Thomas Lovén
|
name = Thomas Lovén
|
||||||
email = thomasloven@gmail.com
|
email = thomasloven@gmail.com
|
||||||
|
[init]
|
||||||
|
defaultBranch = main
|
||||||
[credential]
|
[credential]
|
||||||
helper = cache
|
helper = cache
|
||||||
[color]
|
[color]
|
||||||
|
22
init.vim
22
init.vim
@ -1,24 +1,43 @@
|
|||||||
|
" Display tab characters, trailing spaces and nbsp
|
||||||
set list
|
set list
|
||||||
set listchars=tab:→\ ,trail:␣,nbsp:⋅
|
set listchars=tab:→\ ,trail:␣,nbsp:⋅
|
||||||
|
|
||||||
|
" Remove unnecessary stuff from bottom of window
|
||||||
set noruler
|
set noruler
|
||||||
set laststatus=2
|
set laststatus=2
|
||||||
|
|
||||||
|
" Nice line numbers
|
||||||
set number
|
set number
|
||||||
set relativenumber
|
set relativenumber
|
||||||
|
|
||||||
|
" Spaces over tabs every day of the week (except in makefiles)
|
||||||
set expandtab
|
set expandtab
|
||||||
set tabstop=2
|
set tabstop=2
|
||||||
set shiftwidth=2
|
set shiftwidth=2
|
||||||
set softtabstop=2
|
set softtabstop=2
|
||||||
set smartindent
|
set smartindent
|
||||||
|
|
||||||
|
" Window navigation shortcuts
|
||||||
nnoremap <c-h> <c-w>h
|
nnoremap <c-h> <c-w>h
|
||||||
nnoremap <c-j> <c-w>j
|
nnoremap <c-j> <c-w>j
|
||||||
nnoremap <c-k> <c-w>k
|
nnoremap <c-k> <c-w>k
|
||||||
nnoremap <c-l> <c-w>l
|
nnoremap <c-l> <c-w>l
|
||||||
|
|
||||||
|
" ö for quick command access on Swedish keyboards
|
||||||
nnoremap ö :
|
nnoremap ö :
|
||||||
|
|
||||||
|
" Some navigation shortcuts for Swedish keyboards
|
||||||
|
nnoremap - `
|
||||||
|
nmap Å [
|
||||||
|
nmap å ]
|
||||||
|
omap Å [
|
||||||
|
omap å ]
|
||||||
|
xmap Å [
|
||||||
|
xmap å ]
|
||||||
|
noremap ÅÅ [[
|
||||||
|
noremap åå ]]
|
||||||
|
|
||||||
|
" Some searching options
|
||||||
set ignorecase
|
set ignorecase
|
||||||
set smartcase
|
set smartcase
|
||||||
set incsearch
|
set incsearch
|
||||||
@ -30,3 +49,6 @@ nnoremap * *N
|
|||||||
noh
|
noh
|
||||||
|
|
||||||
set hidden
|
set hidden
|
||||||
|
|
||||||
|
" Uppercase last word on c-^
|
||||||
|
inoremap <C-]> <Esc>gUiw`]a
|
||||||
|
71
install.sh
71
install.sh
@ -4,13 +4,17 @@ function install_dependencies() {
|
|||||||
sudo -n apt-get update
|
sudo -n apt-get update
|
||||||
sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
fish \
|
fish \
|
||||||
neovim
|
neovim \
|
||||||
|
tmux
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_ssh() {
|
function setup_ssh() {
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
touch ~/.ssh/config
|
touch ~/.ssh/config
|
||||||
chmod 644 ~/.ssh/config
|
chmod 644 ~/.ssh/config
|
||||||
|
cat << EOF >> ~/.ssh/config
|
||||||
|
Include ${HOME}/dotfiles/ssh.config
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_git() {
|
function setup_git() {
|
||||||
@ -22,43 +26,50 @@ function setup_git() {
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
setup_ssh
|
setup_ssh
|
||||||
cat << EOF >> ~/.ssh/config
|
|
||||||
Host *
|
|
||||||
AddKeysToAgent yes
|
|
||||||
IdentityFile ~/.ssh/thomas_rsa
|
|
||||||
VisualHostKey yes
|
|
||||||
Host github.com
|
|
||||||
User git
|
|
||||||
Host gitea
|
|
||||||
HostName git.thomasloven.com
|
|
||||||
User git
|
|
||||||
EOF
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
USER=`whoami`
|
function setup_tmux() {
|
||||||
|
cat << EOF > ~/.tmux.conf
|
||||||
|
source ${HOME}/dotfiles/tmux/tmux.conf
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
if [[ ${REMOTE_CONTAINERS} || ${DEVCONTAINER} ]]; then
|
function setup_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
|
||||||
|
|
||||||
echo "INSTALLING IN DEVCONTAINER"
|
mkdir -p ~/.config/
|
||||||
|
ln -s ~/dotfiles/fish ~/.config/fish
|
||||||
|
}
|
||||||
|
|
||||||
fi
|
function setup_nvim() {
|
||||||
|
mkdir -p ~/.config/nvim/
|
||||||
|
ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim
|
||||||
|
}
|
||||||
|
|
||||||
install_dependencies
|
function main() {
|
||||||
|
|
||||||
sudo -n chsh $USER -s $(which fish)
|
if [[ ${REMOTE_CONTAINERS} || ${DEVCONTAINER} ]]; then
|
||||||
echo "exec $(which fish) -l" >> ~/.profile
|
|
||||||
echo "exec $(which fish) -l" >> ~/.bashrc
|
|
||||||
echo "exec $(which fish) -l" >> ~/.zshrc
|
|
||||||
|
|
||||||
echo "sv_SE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
|
echo "INSTALLING IN DEVCONTAINER"
|
||||||
sudo locale-gen
|
|
||||||
|
|
||||||
setup_ssh
|
fi
|
||||||
setup_git
|
|
||||||
|
|
||||||
mkdir -p ~/.config/
|
install_dependencies
|
||||||
ln -s ~/dotfiles/fish ~/.config/fish
|
|
||||||
mkdir -p ~/.config/nvim/
|
|
||||||
ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim
|
|
||||||
|
|
||||||
|
|
||||||
|
echo "sv_SE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
|
||||||
|
sudo locale-gen
|
||||||
|
|
||||||
|
setup_fish
|
||||||
|
setup_ssh
|
||||||
|
setup_git
|
||||||
|
setup_tmux
|
||||||
|
setup_nvim
|
||||||
|
}
|
||||||
|
|
||||||
|
main $@
|
||||||
|
8
ssh.config
Normal file
8
ssh.config
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Host *
|
||||||
|
AddKeysToAgent yes
|
||||||
|
VisualHostKey yes
|
||||||
|
Host github.com
|
||||||
|
User git
|
||||||
|
Host gitea
|
||||||
|
HostName git.thomasloven.com
|
||||||
|
User git
|
@ -4,6 +4,9 @@ cd "$(dirname "$0")/.."
|
|||||||
|
|
||||||
docker build . -t dotfiles -f test/Dockerfile.devcontainer --force-rm
|
docker build . -t dotfiles -f test/Dockerfile.devcontainer --force-rm
|
||||||
|
|
||||||
docker run --rm -it -v $(pwd):/workspaces/test dotfiles zsh
|
docker run --rm -it \
|
||||||
|
-v $(pwd):/workspaces/test \
|
||||||
|
-v $(dirname $SSH_AUTH_SOCK):$(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK\
|
||||||
|
dotfiles zsh
|
||||||
|
|
||||||
docker rmi dotfiles
|
docker rmi dotfiles
|
||||||
|
Loading…
x
Reference in New Issue
Block a user