Skip to content

Commit

Permalink
🐛 Fix a typo about yamllint
Browse files Browse the repository at this point in the history
Fix ptpython config because external APIs about cursor changed
Support TI-CGT
Update .config/latexindent.yaml
Add brewfile in vim config
Add .bash_profile in vim startify's config
Support perl in PKGBUILD template
Update python.yml, remove pre-commit and support windows by PYTHONUTF8=1
Update visidata config
Update pre-commit.ci, add nixpkgs-fmt
Remove $PERL5LIB and add $PERL_CPANM_OPT
Add zsh-completions-for-cross-compilers
Add readline config about reply
  • Loading branch information
Freed-Wu committed Mar 21, 2023
1 parent 8682abb commit 8f68a29
Show file tree
Hide file tree
Showing 54 changed files with 664 additions and 191 deletions.
13 changes: 11 additions & 2 deletions .bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ elif [[ $OSTYPE == darwin ]]; then
elif [[ -z $DISPLAY ]]; then
export BROWSER=w3m
fi
if [[ $OSTYPE != msys2 && -d /mingw64/bin ]]; then
export PATH=$PATH:/mingw64/bin
if [[ $OSTYPE != msys2 ]]; then
export PATH=$PATH:/${MINGW_ARCH:-mingw64}/bin
fi
if [[ $OSTYPE == linux-android ]]; then
export PATH=$PATH:/system/bin:/system/xbin:/vendor/bin:/product/bin:/sbin
Expand All @@ -36,6 +36,15 @@ if [[ $OSTYPE == linux-android ]]; then
else
export MANPAGER="sh -c 'col -bx | bat --color=always -plman | less --pattern=^[A-Z][A-Z\ ]+'"
fi
# https://aur.archlinux.org/packages/ccstudio#comment-906326
export PATH=$PATH:/opt/ccstudio/ccs/eclipse:/opt/ccstudio/ccs/ccs_base/common/uscif:/opt/ccstudio/ccs/ccs_base/scripting/bin
# ccstudio
_C6X_C_DIR=$(find /opt/ccstudio/ccs/tools/compiler -name 'ti-cgt-c6000_*')
export C6X_C_DIR
C6X_C_DIR="$_C6X_C_DIR/include;$_C6X_C_DIR/lib"
unset _C6X_C_DIR
export C6X_C_OPTION
C6X_C_OPTION=--issue_remarks
# less
export LESS='--mouse --chop-long-lines -I -R -M'
# interactively
Expand Down
1 change: 1 addition & 0 deletions .config/bat/config
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
-m'WORKSPACE:Python'
-m'*.drv:Nix'
-m'*.cff:YAML'
-m'*.gel:C'

# https://github.com/sharkdp/bat/issues/2358
-m'*.aux:LaTeX'
Expand Down
3 changes: 0 additions & 3 deletions .config/fcitx5/conf/notifications.conf

This file was deleted.

1 change: 1 addition & 0 deletions .config/latexindent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
---
defaultIndent: " "
indentPreamble: 1
onlyOneBackUp: 1
fileExtensionPreference:
.dtx: 1
.ins: 2
Expand Down
2 changes: 2 additions & 0 deletions .config/mimeapps.list
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ image/x-xpixmap=lximage-qt.desktop;
image/svg+xml=lximage-qt.desktop;
application/rtf=libreoffice-writer.desktop;
application/pdf=org.pwmt.zathura.desktop;
x-scheme-handler/eclipse+command x-scheme-handler/eclipse+mpc=_opt_ccstudio_ccs_eclipse_.desktop
x-scheme-handler/baiduyunguanjia=baidunetdisk.desktop
1 change: 1 addition & 0 deletions .config/nvim/autoload/init/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function! init#coc#source() abort
let g:coc_status_warning_sign = ''
" https://github.com/neoclide/coc.nvim/issues/4282#issuecomment-1279692192
let g:coc_filetype_map = {
\ 'brewfile': 'ruby',
\ 'bash': 'sh',
\ 'zsh': 'sh',
\ 'vimspec': 'vim',
Expand Down
1 change: 1 addition & 0 deletions .config/nvim/autoload/init/fern.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
scriptencoding utf-8
function! init#fern#source() abort
let g:fern#renderer = 'nerdfont'
let g:fern#mark_symbol = ''
Expand Down
2 changes: 1 addition & 1 deletion .config/nvim/autoload/init/polyglot.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function! init#polyglot#source() abort
" https://github.com/sheerun/vim-polyglot/issues/813
let g:polyglot_disabled = ['csv', 'markdown', 'requirements']
let g:polyglot_disabled = ['csv', 'markdown', 'requirements', 'ld']
endfunction
1 change: 1 addition & 0 deletions .config/nvim/autoload/init/startify.vim
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function! init#startify#source() abort
\ {g:maplocalleader . 's': '~/.zshrc'},
\ {g:maplocalleader . 'z': '~/.zprofile'},
\ {g:maplocalleader . 'x': '~/.xprofile'},
\ {g:maplocalleader . 'b': '~/.bash_profile'},
\ {g:maplocalleader . 'y': fnamemodify(expand('$XDG_CONFIG_HOME/ptpython/config.py'), ':~')},
\ {g:maplocalleader . 'p': fnamemodify(expand('$PYTHONSTARTUP'), ':~')},
\ ]
Expand Down
5 changes: 4 additions & 1 deletion .config/nvim/ftdetect/filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ augroup init_filetype
autocmd BufNewFile,BufRead */pacman.d/mirrorlist{,.*},MANIFEST.SKIP setfiletype conf
autocmd BufNewFile,BufRead .SRCINFO setfiletype jproperties
autocmd BufNewFile,BufRead *.{jupyterlab-settings,sublime-{project,settings},vsconfig,jscsrc,jshintrc,plan,ccls,sublime-workspace,css.map} setfiletype json
autocmd BufNewFile,BufRead */.bundle/config,*.mplstyle setfiletype yaml
autocmd BufNewFile,BufRead */.bundle/config,*.mplstyle,.clangd setfiletype yaml
" 1}}} Data_Describe "

" Template {{{1 "
Expand All @@ -26,6 +26,7 @@ augroup init_filetype
" 1}}} Mark_Up "

" Script {{{1 "
autocmd BufNewFile,BufRead */ldscripts/*,*.{map,cmd} setfiletype ld
autocmd BufNewFile,BufRead *.bats,.bash_history setfiletype bash
autocmd BufNewFile,BufRead *.zsh-theme,.zsh_history setfiletype zsh
autocmd BufNewFile,BufRead .mysql_history setfiletype mysql
Expand All @@ -40,7 +41,9 @@ augroup init_filetype
" 1}}} Script "

" Compile {{{1 "
autocmd BufNewFile,BufRead *.{s,S,sa} setfiletype asm
autocmd BufNewFile,BufRead *.cl setfiletype opencl
autocmd BufNewFile,BufRead *.gel setfiletype c
" 1}}} Compile "
augroup END
" ex: foldmethod=marker
2 changes: 2 additions & 0 deletions .config/nvim/ftplugin/dosini.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ if expand('%:t') ==# 'mimeapps.list'
setlocal path=~/.local/share/applications/**,/usr/share/applications/**
elseif expand('%:t') ==# 'setup.cfg'
let b:browser_search_default_engine = 'pypi'
elseif expand('%:t') ==# 'dist.ini'
let b:browser_search_default_engine = 'cpan'
endif

call init#init#dosini#main()
1 change: 1 addition & 0 deletions .config/nvim/lua/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require"nvim-treesitter.configs".setup {
local ft_to_parser = require"nvim-treesitter.parsers".filetype_to_parsername
ft_to_parser.mail = "text"
ft_to_parser.gitcommit = "text"
ft_to_parser.brewfile = "ruby"
ft_to_parser.bbcode = "text"
ft_to_parser.bash = "sh"
ft_to_parser.zsh = "sh"
Expand Down
3 changes: 3 additions & 0 deletions .config/nvim/syntax/asm.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
" /usr/share/nvim/runtime/syntax/asm.vim
syn match asmComment "@.*" contains=asmTodo
syn match asmComment "^#.*" contains=asmTodo
11 changes: 8 additions & 3 deletions .config/nvim/templates/after/%5C.PL%24
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/usr/bin/env perl
# https://github.com/actions/checkout/issues/1190
$VERSION = `git describe --abbrev=0`;
chomp $VERSION;
if ( defined $GITHUB_REF_NAME ) {
$VERSION = $GITHUB_REF_NAME;
}
else {
$VERSION = `git describe --abbrev=0`;
chomp $VERSION;
}
$VERSION = '0.0.0' if $VERSION eq '';
my $filename = shift;
exit unless $filename;
open my $out, ">$filename" or die "Can't create `$filename'!";
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions .config/nvim/templates/after/%5C.pm%24
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package {{ substitute(substitute(expand('%:r'), '\%(/\|^\)\(.\)', '::\u\1', 'g'), '^::Lib::', '', 'g') }}
use strict;
use warnings;
use Exporter qw(import);
our @EXPORT = qw();

1;

__END__

Expand Down
2 changes: 1 addition & 1 deletion .config/nvim/templates/beamer.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\documentclass[aspectratio=169]{beamer}
\usetheme{Berkeley}
\usetheme[width=0pt]{Berkeley}
\usecolortheme{spruce}
\begin{document}

Expand Down
4 changes: 4 additions & 0 deletions .config/nvim/templates/before/%2F%5C.clangd%24
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
CompileFlags:
Add:
- -I.
8 changes: 1 addition & 7 deletions .config/nvim/templates/before/%2F%5C.readthedocs%5C.yaml%24
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@ build:
os: ubuntu-22.04
tools:
python: "3"
jobs:
pre_build:
- pip install .

sphinx:
configuration: docs/conf.py

formats:
- pdf
- htmlzip

python:
install:
Expand Down
5 changes: 4 additions & 1 deletion .config/nvim/templates/before/%2FMANIFEST%5C.SKIP%5C.bak%24
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# https://github.com/Perl-Toolchain-Gang/ExtUtils-Manifest/pull/17
#!include_default
^\.vscode/
^MANIFEST\.SKIP$
^\..*
^package\.json$
^scripts/
^{{ expand('%:p:h:t') }}-
11 changes: 7 additions & 4 deletions .config/nvim/templates/before/%2FMakefile%5C.PL%24
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
#!/usr/bin/env perl
use Env qw(GITHUB_REF_NAME);
use File::Copy 'cp';
use ExtUtils::MakeMaker;

cp 'MANIFEST.SKIP.bak', 'MANIFEST.SKIP';
if ( defined $GITHUB_REF_NAME ) {
$version = $GITHUB_REF_NAME;
$VERSION = $GITHUB_REF_NAME;
}
else {
$version = `git describe --abbrev=0`;
chomp $version;
$VERSION = `git describe --abbrev=0`;
chomp $VERSION;
}
$VERSION = '0.0.0' if $VERSION eq '';

WriteMakefile(
NAME => '{{ substitute(substitute(expand('%:p:h:t'), '\%(-\|^\)\(.\)', '::\u\1', 'g'), '^::', '', 'g') }}',
LICENSE => 'gpl_3',
AUTHOR => '{{ g:snips_author }} <{{ g:snips_email }}>',
VERSION_FROM => '{{ expand('%:p:h:t') }}.PL',
VERSION => $VERSION,
ABSTRACT_FROM => '{{ expand('%:p:h:t') }}.PL',
EXE_FILES => ['{{ expand('%:p:h:t') }}'],
);
30 changes: 28 additions & 2 deletions .config/nvim/templates/before/%2FPKGBUILD%24
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,61 @@ source=("$url/archive/$_upstreamver.tar.gz")
# _os="${OSTYPE%%-*}"
# [[ $_os == windows ]] && _ext=zip || _ext=tar.gz
# source=("$url/releases/download/$_upstreamver/${pkgname}_${_os}_${_arch}.$_ext")
# source=("https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/${_pkgname//-/_}-$pkgver.tar.gz")
# source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/${_pkgname//-/_}-$pkgver.tar.gz")
# _py=py3
# source=("https://files.pythonhosted.org/packages/$_py/${_pkgname:0:1}/$_pkgname/${_pkgname//-/_}-$pkgver-$_py-none-any.whl")
# source=("https://files.pythonhosted.org/packages/$_py/${_pkgname::1}/$_pkgname/${_pkgname//-/_}-$pkgver-$_py-none-any.whl")
# source=("https://cpan.metacpan.org/authors/id/F/FR/FREED/$_pkgname-$pkgver.tar.gz")
sha256sums=(SKIP)

# pkgver() {
# cd "$srcdir/$_pkgname" || return 1
# printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
# }

# build() {
# cd $_pkgname-$pkgver || return 1
# unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
# export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
# perl Makefile.PL
# make
# }

# check() {
# cd $_pkgname-$pkgver || return 1
# unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
# export PERL_MM_USE_DEFAULT=1
# make test
# }

package() {
cd "$srcdir/$_pkgname" || return 1

install -D "$_pkgname" -t "$pkgdir/usr/bin"
install -Dm644 README.md -t "$pkgdir/usr/share/doc/$_pkgname"

# make DESTDIR="$pkgdir" install

# cd "$srcdir/$_pkgname-$pkgver" || return 1
# python setup.py install --root="$pkgdir" --optimize=1

# cd "$srcdir" || return 1
# python -m installer --destdir="$pkgdir" ./*.whl

# cd $_pkgname-$pkgver || return 1
# unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
# make install INSTALLDIRS=vendor DESTDIR="$pkgdir"

# local bin
# bin=${_repo##*/}
# help2man "$pkgdir/usr/bin/$bin" | gzip >"$bin.1.gz"
# install -Dm644 "$bin.1.gz" -t "$pkgdir/usr/share/man/man1"

# PYTHONPATH="$(ls -d "$pkgdir"/usr/lib/python*/site-packages)"
# export PYTHONPATH
# "$pkgdir/usr/bin/$bin" --print-completion bash > "$bin.bash"
# "$pkgdir/usr/bin/$bin" --print-completion zsh > "_$bin"
# "$pkgdir/usr/bin/$bin" --print-completion tcsh > "$bin.csh"

# local complete
# complete="_$(echo ${bin//-/_} | tr a-z A-Z)_COMPLETE"
# eval "$complete=zsh_source" "$bin" > "$bin.bash"
Expand Down
2 changes: 2 additions & 0 deletions .config/nvim/templates/before/%2FREADME%5C.md%24
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# {{ expand('%:p:h:t') }}

[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/{{ split(g:snips_github, '/')[-1] }}/{{ expand('%:p:h:t') }}/main.svg)](https://results.pre-commit.ci/latest/github/{{ split(g:snips_github, '/')[-1] }}/{{ expand('%:p:h:t') }}/main)
[![github/workflow](https://github.com/{{ split(g:snips_github, '/')[-1] }}/{{ expand('%:p:h:t') }}/actions/workflows/main.yml/badge.svg)](https://github.com/{{ split(g:snips_github, '/')[-1] }}/{{ expand('%:p:h:t') }}/actions)
[![codecov](https://codecov.io/gh/{{ split(g:snips_github, '/')[-1] }}/{{ expand('%:p:h:t') }}/branch/main/graph/badge.svg)](https://codecov.io/gh/{{ split(g:snips_github, '/')[-1] }}/{{ expand('%:p:h:t') }})
Expand Down
6 changes: 3 additions & 3 deletions .config/nvim/templates/before/%2Fpyproject%5C.toml%24
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools >= 45", "setuptools_scm[toml] >= 6.2", "setuptools-generate"]
requires = ["setuptools_scm[toml] >= 6.2", "setuptools-generate"]
build-backend = "setuptools.build_meta"

# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
Expand Down Expand Up @@ -49,10 +49,10 @@ Source = "{{ g:snips_github }}/{{ expand('%:p:h:t') }}"
[tool.setuptools.dynamic.dependencies]
file = "requirements.txt"

# begin: scripts/generate-pyproject.toml.pl
# begin: scripts/update-pyproject.toml.pl
[tool.setuptools.dynamic.optional-dependencies.dev]
file = "requirements/dev.txt"
# end: scripts/generate-pyproject.toml.pl
# end: scripts/update-pyproject.toml.pl

[tool.setuptools_scm]
write_to = "src/{{ substitute(expand('%:p:h:t'), '-', '_', 'g') }}/_version.py"
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions .config/nvim/templates/before/%2Fscripts%2F.%2A%5C.pl%24
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env -S perl -pi
{% here %}
File renamed without changes.
5 changes: 5 additions & 0 deletions .config/nvim/templates/before/%2Ft%2F.%2A%5C.t%24
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use Test::More;

ok({% here %});

done_testing();
12 changes: 12 additions & 0 deletions .config/nvim/templates/before/%5C.rubocop%5C.yml%24
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env -S rubocop -c
---
Layout/LineLength:
Max: 118
Naming/FileName:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/Documentation:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
30 changes: 28 additions & 2 deletions .config/nvim/templates/perl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,41 @@ permissions:
contents: write

jobs:
test:
strategy:
fail-fast: false
matrix:
runs-on:
- ubuntu-latest
- macos-latest
runs-on: $\{\{ matrix.runs-on \}\}
steps:
- uses: actions/checkout@v3
- uses: shogo82148/actions-setup-perl@v1
- name: Install
run: |
./Makefile.PL
make manifest
make install
- name: Install Requirements
if: startsWith(github.ref, 'refs/tags/')
run: |
cpanm -qn Devel::Cover Devel::Cover::Report::Codecovbash
- name: Test
run: |
make test
cover -test -report codecovbash
- uses: codecov/codecov-action@v3

deploy:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: shogo82148/actions-setup-perl@v1
- name: Build
run: |
./Makefile.PL
cp MANIFEST.SKIP.bak MANIFEST.SKIP
make manifest
make dist
- uses: actions/upload-artifact@v3
Expand All @@ -44,7 +70,7 @@ jobs:
- name: Install Requirements
if: startsWith(github.ref, 'refs/tags/')
run: |
cpan CPAN::Uploader
cpanm -qn CPAN::Uploader
- name: Upload
if: startsWith(github.ref, 'refs/tags/')
run: >
Expand Down
Loading

0 comments on commit 8f68a29

Please sign in to comment.