diff --git a/.config/nvim/after/plugin/lualine.rc.lua b/.config/nvim/after/plugin/lualine.rc.lua index 67839ef..e779c8a 100644 --- a/.config/nvim/after/plugin/lualine.rc.lua +++ b/.config/nvim/after/plugin/lualine.rc.lua @@ -5,7 +5,7 @@ if (not status) then return end lualine.setup { options = { icons_enabled = true, - theme = 'solarized_dark', + theme = 'onedark', section_separators = { left = '', right = '' diff --git a/.config/nvim/after/plugin/onedark.rc.lua b/.config/nvim/after/plugin/onedark.rc.lua new file mode 100644 index 0000000..7747a53 --- /dev/null +++ b/.config/nvim/after/plugin/onedark.rc.lua @@ -0,0 +1,13 @@ +local status, onedark = pcall(require, "onedark") + +if not status then return end + +onedark.setup { + style = "dark", + transparent = true, + lualine = { + transparent = true, + }, +} + +onedark.load() diff --git a/.config/nvim/lua/juancwu/packer.lua b/.config/nvim/lua/juancwu/packer.lua index f5fe94b..e2ec1d7 100644 --- a/.config/nvim/lua/juancwu/packer.lua +++ b/.config/nvim/lua/juancwu/packer.lua @@ -18,7 +18,8 @@ return require('packer').startup(function(use) -- colorscheme use "tjdevries/colorbuddy.nvim" - use "svrana/neosolarized.nvim" +-- use "svrana/neosolarized.nvim" + use "navarasu/onedark.nvim" -- treesitter baby use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) diff --git a/.config/powershell/profile.ps1 b/.config/powershell/profile.ps1 new file mode 100644 index 0000000..75a82f0 --- /dev/null +++ b/.config/powershell/profile.ps1 @@ -0,0 +1,91 @@ +# Prompt +oh-my-posh init pwsh --config 'https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/catppuccin_mocha.omp.json' | Invoke-Expression + +# Terminal Icons +Import-Module -Name Terminal-Icons + +# Set up autocompletion +Import-Module -Name PSReadLine +Set-PSReadLineOption -EditMode Emacs +Set-PSReadLineOption -BellStyle None +Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar +Set-PSReadLineOption -PredictionSource History +Set-PSReadLineOption -PredictionViewStyle ListView + +# Fzf +Import-Module PSFzf + +# Simulate the peco change directory functionality from mac/linux setups +function Fuzzy-Find { + param( + [boolean]$file = $false, + [boolean]$a = $false, # shows only current working directory + [int]$depth = 2 + ) + + $ghq = "$env:USERPROFILE\ghq" + $app_data = "$env:USERPROFILE\AppData\Local" + $cwd_ = (Get-Location).Path + + + if ($file) { + if (!$a) { + $items = Get-ChildItem $cwd_ -Recurse -Attributes !Directory -Depth $depth + } else { + $f1 = Get-ChildItem $cwd_, $app_data -Recurse -Attributes !Directory -Depth $depth + $f2 = Get-ChildItem $ghq -Recurse -Attributes !Directory -Depth 3 + $items = @($f1 ; $f2) + } + } else { + if (!$a) { + $items = Get-ChildItem $cwd_ -Recurse -Attributes Directory -Depth $depth + } else { + $dir1 = Get-ChildItem $cwd_, $app_data -Recurse -Attributes Directory -Depth $depth + $dir2 = Get-ChildItem $ghq -Recurse -Attributes Directory -Depth 3 + $items = @($dir1 ; $dir2) + } + } + + $selected = $items | Invoke-Fzf + if ($selected -ne $null) { + if ($file) { + vim $selected + } else { + Set-Location $selected + } + } +} + +# Alias to run the peco-like function +function sf([switch]$a, [int]$d=2) { + Fuzzy-Find -file $true -a $a -depth $d +} +function sd([switch]$a, [int]$d=2) { + Fuzzy-Find -file $false -a $a -depth $d +} + + +# Set up an alias to clone repository using gh cli to a predefined location +# This helps organize the repositories +function Get-RepoName([string]$repo) { + gh repo view $repo | Select-String "^name:" | ForEach-Object { $_ -replace "name:","" } | ForEach-Object { $_.Trim() } +} + +function clone([string]$repo) { + $name = Get-RepoName $repo + gh repo clone "$name" "$env:USERPROFILE/ghq/$name" +} + +function which($command) { + Get-Command -Name $command -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue +} + +function link($link, $target) { + New-Item -ItemType SymbolicLink -Path "$link" -Target "$target" +} + +Set-Alias ll ls +Set-Alias g git +Set-Alias cc clear +Set-Alias grep findstr +Set-Alias vim nvim