maint: setting up on wsl2 (opensuse tumbleweed)

This commit is contained in:
Matthew Ryan Dillon 2021-10-26 13:31:41 -07:00
parent 2c7b5d0315
commit 0e13a23357
9 changed files with 232 additions and 138 deletions

View file

@ -1,5 +1,31 @@
# dotfiles # dotfiles
## opensuse tumbleweed
```bash
$ sudo visudo # add /opt/miniconda3/bin to secure_paths
$ sudo zypper install git libopenssl-1_1-devel tree zsh ripgrep
$ sudo zypper install -t pattern devel_C_C++
$ sudo chsh -s $(which zsh)
$ sudo hostname rattusrattus
$ sudo systemd-tmpfiles --create
$ sudo echo "[interop]\nappendWindowsPath = false" > /etc/wsl.conf
$ git clone --origin pingo ssh://git@pingo.thermokar.st/dotfiles ~/.dotfiles
$ git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell
$ git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
$ cd ~/.dotfiles
$ ./install
$ source ~/.zshrc
$ base16_ashes
$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
$ sudo sh Miniconda3-latest-Linux-x86_64.sh -p /opt/miniconda3 -b
$ sudo conda update conda
$ wget https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-py38-linux-conda.yml
$ conda env create -n q2dev --file qiime2-latest-py38-linux-conda.yml
```
## macos
```bash ```bash
$ wget -O gwar https://github.com/thermokarst/gwar/releases/download/0.0.1/gwar-macos $ wget -O gwar https://github.com/thermokarst/gwar/releases/download/0.0.1/gwar-macos
$ chmod +x gwar $ chmod +x gwar

View file

@ -2,8 +2,7 @@
name = Matthew Dillon name = Matthew Dillon
email = matthewrdillon@gmail.com email = matthewrdillon@gmail.com
[core] [core]
editor = vim editor = nvim
excludesfile = /Users/matthew/.gitignore_global
[color] [color]
diff = auto diff = auto
status = auto status = auto

View file

@ -10,7 +10,9 @@
- link: - link:
~/.tmux.conf: tmux.conf ~/.tmux.conf: tmux.conf
~/.gitconfig: git/gitconfig ~/.gitconfig: git/gitconfig
~/.gitignore_global: git/gitignore_global ~/.config/git/ignore:
create: true
path: git/gitignore_global
~/.npmrc: npmrc ~/.npmrc: npmrc
~/.psqlrc: psqlrc ~/.psqlrc: psqlrc
~/.vimrc: vimrc ~/.vimrc: vimrc
@ -34,4 +36,13 @@
path: kakrc path: kakrc
~/.config/nvim/init.vim: ~/.config/nvim/init.vim:
create: true create: true
path: nvim_init.vim path: nvim/init.vim
~/.config/nvim/init.vim:
create: true
path: nvim/init.vim
~/.config/nvim/lua/plugins.lua:
create: true
path: nvim/plugins.lua
~/bin/safe-reattach-to-user-namespace:
create: true
path: safe-reattach-to-user-namespace.sh

25
nvim/init.vim Normal file
View file

@ -0,0 +1,25 @@
" Stick with vimscript file at the moment, but prefer lua for config
" TODO: fix this vimscript fallback
set backupdir=~/.vim-tmp
set directory=~/.vim-tmp
lua << EOF
local set = vim.opt
set.number = true
set.autoindent = true
set.colorcolumn = {80, 100, 120}
set.cursorline = true
set.expandtab = true
set.backup = true
set.writebackup = true
set.list = true
set.listchars = { trail = '~', tab = '>=' }
set.mouse = 'a'
set.completeopt = { 'menu', 'menuone', 'noselect' }
set.termguicolors = true
require('plugins')
EOF

141
nvim/plugins.lua Normal file
View file

@ -0,0 +1,141 @@
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({
'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path
})
end
return require('packer').startup(function()
-----------------------------------------------------------------------------
use 'wbthomason/packer.nvim'
-----------------------------------------------------------------------------
use 'wakatime/vim-wakatime'
-----------------------------------------------------------------------------
use {
'neovim/nvim-lspconfig',
config = function()
lspconfig = require('lspconfig')
lspconfig.pyright.setup({
settings = {
python = {
venvPath = "~/.conda/envs",
analysis = {
useLibraryCodeForTypes = true,
}
}
}
})
lspconfig.rust_analyzer.setup({})
end,
}
-----------------------------------------------------------------------------
use {
'chriskempson/base16-vim',
config = function()
vim.cmd('source ~/.vimrc_background')
vim.g.base16colorspace = 256
end,
}
-----------------------------------------------------------------------------
use {
'nvim-telescope/telescope.nvim',
requires = {
{ 'nvim-lua/plenary.nvim' },
{ 'kyazdani42/nvim-web-devicons' },
},
config = function()
vim.api.nvim_set_keymap('n', '-', '<cmd>Telescope find_files<CR>', { noremap = true })
end,
}
-----------------------------------------------------------------------------
use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }
-----------------------------------------------------------------------------
use {
'hrsh7th/nvim-cmp',
requires = {
{ 'hrsh7th/cmp-vsnip', after = "nvim-cmp" },
{ 'hrsh7th/cmp-nvim-lsp', after = "nvim-cmp" },
{ 'hrsh7th/cmp-buffer', after = "nvim-cmp" },
{ 'hrsh7th/vim-vsnip', after = "nvim-cmp" },
},
config = function()
local cmp = require('cmp')
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'vsnip' },
{ name = 'buffer' },
}
})
end,
}
-----------------------------------------------------------------------------
use {
'lewis6991/gitsigns.nvim',
requires = { { 'nvim-lua/plenary.nvim' } },
config = function()
require('gitsigns').setup({})
end,
}
-----------------------------------------------------------------------------
use {
'simrat39/rust-tools.nvim',
requires = {
{ 'nvim-lua/popup.nvim' },
{ 'nvim-lua/plenary.nvim' },
},
config = function()
require('rust-tools').setup({})
end,
}
-----------------------------------------------------------------------------
use {
'GustavoKatel/sidebar.nvim',
requires = { { 'GustavoKatel/todo-comments.nvim' } },
config = function()
require('sidebar-nvim').setup({
side = 'right',
sections = { 'datetime', 'git-status', 'lsp-diagnostics', 'todos' }
})
end,
}
-----------------------------------------------------------------------------
use {
'famiu/feline.nvim',
config = function()
require('feline').setup({ preset = 'noicon' })
end,
}
-----------------------------------------------------------------------------
if packer_bootstrap then
require('packer').sync()
end
end)

View file

@ -1,120 +0,0 @@
" Stick with vimscript at the moment, but prefer lua for config
lua << EOF
local set = vim.opt
set.number = true
set.autoindent = true
set.colorcolumn = {80, 100, 120}
set.cursorline = true
set.expandtab = true
set.backup = true
set.backupdir = { '~/.vim-tmp', '~/.tmp', '~/tmp', '/var/tmp', '/tmp' }
set.backupskip = { '/tmp/*', '/private/tmp/*' }
set.directory = { '~/.vim-tmp', '~/.tmp', '~/tmp', '/var/tmp', '/tmp' }
set.writebackup = true
set.list = true
set.listchars = { trail = '~', tab = '>=' }
set.mouse = 'a'
set.completeopt = { 'menu', 'menuone', 'noselect' }
set.termguicolors = true
require('packer').startup(function()
-----------------------------------------------------------------------------
use 'wbthomason/packer.nvim'
-----------------------------------------------------------------------------
use 'wakatime/vim-wakatime'
-----------------------------------------------------------------------------
use 'neovim/nvim-lspconfig'
require('lspconfig').pyright.setup({
settings = {
python = {
venvPath = "~/.conda/envs",
analysis = {
useLibraryCodeForTypes = true,
}
}
}
})
require('lspconfig').rust_analyzer.setup({})
-----------------------------------------------------------------------------
use 'chriskempson/base16-vim'
vim.cmd('source ~/.vimrc_background')
vim.g.base16colorspace = 256
-----------------------------------------------------------------------------
use {
'nvim-telescope/telescope.nvim',
requires = {
{ 'nvim-lua/plenary.nvim' },
{ 'kyazdani42/nvim-web-devicons' }
}
}
vim.api.nvim_set_keymap('n', '-', '<cmd>Telescope find_files<CR>', { noremap = true })
-----------------------------------------------------------------------------
use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }
-----------------------------------------------------------------------------
use 'hrsh7th/nvim-cmp'
use 'hrsh7th/cmp-nvim-lsp'
use 'hrsh7th/cmp-buffer'
use 'hrsh7th/cmp-vsnip'
use 'hrsh7th/vim-vsnip'
local cmp = require('cmp')
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'vsnip' },
{ name = 'buffer' },
}
})
-----------------------------------------------------------------------------
use {
'lewis6991/gitsigns.nvim',
requires = { { 'nvim-lua/plenary.nvim' } }
}
require('gitsigns').setup({})
-----------------------------------------------------------------------------
use {
'simrat39/rust-tools.nvim',
requires = {
{ 'nvim-lua/popup.nvim' },
{ 'nvim-lua/plenary.nvim' }
}
}
require('rust-tools').setup({})
-----------------------------------------------------------------------------
use {
'GustavoKatel/sidebar.nvim',
requires = { { 'GustavoKatel/todo-comments.nvim' } }
}
require('sidebar-nvim').setup({
side = 'right',
sections = { 'datetime', 'git-status', 'lsp-diagnostics', 'todos' }
})
-----------------------------------------------------------------------------
use 'famiu/feline.nvim'
require('feline').setup({ preset = 'noicon' })
end)
EOF

View file

@ -1,6 +1,6 @@
# personal # personal
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/personal" path = "$HOME/projects/personal"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@pingo.thermokar.st" origin.base_addr = "ssh://git@pingo.thermokar.st"
origin.name = "pingo" origin.name = "pingo"
@ -19,7 +19,7 @@ remotes = []
# personal-dokku # personal-dokku
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/personal" path = "$HOME/projects/personal"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@pingo.thermokar.st" origin.base_addr = "ssh://git@pingo.thermokar.st"
origin.name = "pingo" origin.name = "pingo"
@ -35,7 +35,7 @@ remotes = [
# mds # mds
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/mds" path = "$HOME/projects/mds"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@pingo.thermokar.st" origin.base_addr = "ssh://git@pingo.thermokar.st"
origin.name = "pingo" origin.name = "pingo"
@ -55,7 +55,7 @@ remotes = []
# github-thermokarst-personal # github-thermokarst-personal
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/personal" path = "$HOME/projects/personal"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@github.com/thermokarst" origin.base_addr = "ssh://git@github.com/thermokarst"
origin.name = "thermokarst" origin.name = "thermokarst"
@ -66,7 +66,7 @@ remotes = []
# github-thermokarst-qiime2 # github-thermokarst-qiime2
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/qiime2" path = "$HOME/projects/qiime2"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@github.com/thermokarst" origin.base_addr = "ssh://git@github.com/thermokarst"
origin.name = "thermokarst" origin.name = "thermokarst"
@ -78,7 +78,7 @@ remotes = []
# github-thermokarst-forks-qiime2 # github-thermokarst-forks-qiime2
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/qiime2" path = "$HOME/projects/qiime2"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@github.com/qiime2" origin.base_addr = "ssh://git@github.com/qiime2"
origin.name = "qiime2" origin.name = "qiime2"
@ -93,6 +93,7 @@ repos = [
"environment-files", "environment-files",
"library", "library",
"logos", "logos",
"package-integration",
"paper1", "paper1",
"paper2", "paper2",
"q2-alignment", "q2-alignment",
@ -150,7 +151,7 @@ remotes = [
# github-thermokarst-forks-caporaso-lab # github-thermokarst-forks-caporaso-lab
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/qiime2" path = "$HOME/projects/qiime2"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@github.com/caporaso-lab" origin.base_addr = "ssh://git@github.com/caporaso-lab"
origin.name = "caporaso-lab" origin.name = "caporaso-lab"
@ -169,7 +170,7 @@ remotes = [
# github-thermokarst-forks-biocore # github-thermokarst-forks-biocore
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/qiime2" path = "$HOME/projects/qiime2"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@github.com/biocore" origin.base_addr = "ssh://git@github.com/biocore"
origin.name = "biocore" origin.name = "biocore"
@ -186,7 +187,7 @@ remotes = [
# github-thermokarst-forks-bokulich-lab # github-thermokarst-forks-bokulich-lab
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/qiime2" path = "$HOME/projects/qiime2"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@github.com/bokulich-lab" origin.base_addr = "ssh://git@github.com/bokulich-lab"
origin.name = "bokulich-lab" origin.name = "bokulich-lab"
@ -200,7 +201,7 @@ remotes = [
# github-thermokarst-forks-conda-forge # github-thermokarst-forks-conda-forge
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/qiime2" path = "$HOME/projects/qiime2"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@github.com/conda-forge" origin.base_addr = "ssh://git@github.com/conda-forge"
origin.name = "conda-forge" origin.name = "conda-forge"
@ -215,7 +216,7 @@ remotes = [
# github-gregcaporaso # github-gregcaporaso
[[workspace]] [[workspace]]
path = "$HOME/Desktop/projects/qiime2" path = "$HOME/projects/qiime2"
ssh_key_path = "$HOME/.ssh/id_ecdsa" ssh_key_path = "$HOME/.ssh/id_ecdsa"
origin.base_addr = "ssh://git@github.com/gregcaporaso" origin.base_addr = "ssh://git@github.com/gregcaporaso"
origin.name = "gregcaporaso" origin.name = "gregcaporaso"

View file

@ -0,0 +1,8 @@
#!/usr/bin/env zsh
# If reattach-to-user-namespace is not available, just run the command.
if [ -n "$(command -v reattach-to-user-namespace)" ]; then
reattach-to-user-namespace $@
else
exec "$@"
fi

View file

@ -1,8 +1,11 @@
# need to set escape-time first, for wsl deploys
set -sg escape-time 50
setw -g automatic-rename setw -g automatic-rename
set-option -g default-shell /bin/zsh set-option -g default-shell $SHELL
set -g default-command "reattach-to-user-namespace -l ${SHELL}" # set -g default-command "~/bin/safe-reattach-to-user-namespace -l ${SHELL}"
set -g default-terminal "screen-256color" set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
set -g prefix C-a set -g prefix C-a
unbind C-b unbind C-b
@ -37,7 +40,6 @@ set -g status-right '\
#[fg=white,bg=default]%a %l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d' #[fg=white,bg=default]%a %l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d'
set-option -g renumber-windows on set-option -g renumber-windows on
set -sg escape-time 0
set-option -g destroy-unattached 'off' set-option -g destroy-unattached 'off'
# Enable mouse control (clickable windows, panes, resizable panes) # Enable mouse control (clickable windows, panes, resizable panes)
@ -45,5 +47,6 @@ set -g mouse on
bind-key -T copy-mode-vi 'v' send -X begin-selection bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# NOTE: the following line is for macos, but its presence doesnt seem to be a prob. on linux
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy' bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
bind-key p paste-buffer bind-key p paste-buffer