pyenv [1] has done a fantastic job with pyenv-installer [2]. Highly recommend taking a look.
This tool is used to install pyenv and friends.
References:
[1]: https://github.com/pyenv
[2]: https://github.com/pyenv/pyenv-installer
Publishing rhythm
When I first moved to vim from and ide like vscode or sublime text one of my
very first issues was trying to preview my website at localhost:8000. There
had always just been a button there to do it in all of my other editors, not
vim. There are not many buttons for anything in vim. While there is probably a
plugin that can run a webserver for me in vim, it’s not necessary, we just need
the command line we are already in.
running a separate process # [1]
You will need a way to run another process alongside vim, here are a couple
ideas to get you going that are not the focus here.style
- use background jobs
- c-z to send a job to the background
- fg to bring it back
- use a second terminal
- use a second tab
- use tmux and run it in a separate split/window
- use an embeded nvim terminal
running a development webserver from the command line # [2]
Python already exists on most linux systems by default, and most are now on
python3. If you are on windows typing python will take you directly to the
windows store to install it, or you can also use wsl.
# python3
python -m http.server
# running on port 5000
python -m http.server --directory markout 5000
# for the low chance ...
Many command line tools can output a list of files, this is quite powerful.
I often want to search for something, then open it from a fuzzy picker. This
can be done with fzf in the terminal, but often I am already in vim and I want
to open it inside my current session.
Telescope # [1]
how to pass a custom command to telescope
Telescope is the fuzzy file finder I use every day inside of neovim. Its pretty
fantastic and easy to extent like this. This first example I am only passing in
files from the current working directory by using ls.
:Telescope find_files find_command=ls
This brings up a normal Telescope picker with results from the ls command.
More arguments # [2]
how to pass a muli-argument command to telescope
Adding more arguments can be done by comma separating them as shown in the
example below. This command will run the silver-searcher, search for all
occurences of nvim inside of a markdown file, and return only the filepaths so
Telescope can pick from them.
:Telescope find_files find_command=ag,nvim,--md,-l
References:
[1]: #telescope
[2]: #more-arguments
Finding hidden files using Telescope as you fuzzy file finder is not too
hard, its a single flag passed in. Then it will use whichever file
finder it can find [‘fd’, ‘fdfind’, ‘rg –files’, ‘find’, or ‘where’] in
that order. These tools each have their own way of handling hidden
files, but telescope takes care of that so all you need to do is pass in
hidden=true.
I have this keymap set to help me list out all files including hidden
files using the pnumonic go edit hidden. I use ge for quite a few
different things to take me directly to a specific file or picker.
nnoremap geh <cmd>Telescope find_files hidden=true<cr>
see the
implementation [1]
telescope finds your files.
References:
[1]: https://github.com/nvim-telescope/telescope.nvim/blob/82e3cc322ad87b262aef092cb7475e769740e83a/lua/telescope/builtin/files.lua#L167-L184
Lately I’ve been on a journey to really clean up my dotfiles, and I was
completely missing fonts. I noticed jumping into a new vm I had a bunch
of broken devicons when using Telescope with the devicons plugins.
This is one of those things that can be a total pain to get right on
some systems, and it’s so nice when it’s just there for you pretty much
out of the box.
- make sure your user fonts directory exists
- chech if the font you want exists on your machine
- download and unzip fonts into the fonts directory
- repeat 2-3 for all the fonts you use on your system
- name: ensure fonts directory
file:
path: "{{ lookup('env', 'HOME') }}/.fonts"
state: directory
- name: Hack exists
shell: "ls {{ lookup('env', 'HOME') }}/.fonts/Hack*Nerd*Font*Complete*"
register: hack_exists
ignore_errors: yes
- name: Download Hack
when: hack_exists is failed
ansible.builtin.unarchive:
src: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Hack.zip
dest: "{{ lookup('env', 'HOME') }}/.fonts/"
remote_src: yes
https://www.youtube.com/watch?v=2MEmsinxRK4
I made a YT based on this post
Links # [1]
- ansible docs for builtin.unarchive [2]
Setup a yaml schema | yamlls...
vim-abolish [1] by tpope [2] is a game-changer in its space. Excited to see how it evolves.
abolish.vim: Work with several variants of a word at once
References:
[1]: https://github.com/tpope/vim-abolish
[2]: https://github.com/tpope
Part of my neovim setup requires having the black python formatter
installed and callable. I install it with pipx so that I don’t have
to manage a virtual environment [1] and have it available everywhere. So
far this works well for me, if there are ever breaking changes I may
need to rethink this.
re-installing a bunch of things that are already installed can be quite
a waste and really add up to my ansible run time, so for most of my
ansible tasks that install a command like this I have been following
this pattern.
- check if the command is installed with command -v <command>
- register that step
- ignore if that step fails
- add a when: <xxx>_exists is failed condition to the step that
installs that command.
- name: check is black installed
shell: command -v black
register: black_exists
ignore_errors: yes
- name: install black
when: black_exists is failed
shell: pipx install black
https://www.youtube.com/watch?v=MCFg6-W5SBI
I made a video based on this post, check it out if its your thing
References:
[1]: /virtual-environment/
Adding a __render__ method that returns a rich renderable to any python class
makes it display this output if printed with rich. This also includes being
nested inside a rich Layout.
import rich
from rich.panel import Panel
class ShowMe:
def __rich__(self):
return Panel("hello", border_style="gold1")
if __name__ == "__main__":
rich.print(ShowMe())
[1]
References:
[1]: https://dropper.waylonwalker.com/file/e260b7fe-4977-4858-af88-c9ad67186014.webp
Fugitive comes with a pretty sick way to commit files and see the diff at the
same time with verbose commit. Opening the fugitive menu with :G brings up
your git [1] status, you can stage files with s, unstage them with u, toggle
them with -, and toggle their diff with >. Once you have staged your files
for commit, you can commit with cc, but today I found that you can commit
verbose with cvc. This brings up not only a commit widow with your git
status shown, but the diff that you are about to commit.
[2]
example of a verbose commit in fugitive
References:
[1]: /glossary/git/
[2]: https://dropper.waylonwalker.com/file/9a963add-494c-47ee-af26-26cb7a3912e8.webp
I came across Talkpython.fm-Notable-Packages [1] from xandrade [2], and it’s packed with great features and ideas.
[unofficial] Talkpython.fm podcast notable PyPI packages compilation
References:
[1]: https://github.com/xandrade/Talkpython.fm-Notable-Packages
[2]: https://github.com/xandrade
Check out aoc-2021-kedro-playground [1] by pypeaday [2]. It’s a well-crafted project with great potential.
No description available.
References:
[1]: https://github.com/pypeaday/aoc-2021-kedro-playground
[2]: https://github.com/pypeaday
Looking for inspiration? dotfiles [1] by elnappo [2].
my .files - powered by Ansible
References:
[1]: https://github.com/elnappo/dotfiles
[2]: https://github.com/elnappo
Just starred aoc_2021 [1] by borgmanJeremy [2]. It’s an exciting project with a lot to offer.
No description available.
References:
[1]: https://github.com/borgmanJeremy/aoc_2021
[2]: https://github.com/borgmanJeremy
Just starred aoc-2021 [1] by pypeaday [2]. It’s an exciting project with a lot to offer.
Advent of Code 2021 repo
References:
[1]: https://github.com/pypeaday/aoc-2021
[2]: https://github.com/pypeaday
The work on neovim [1] by neovim [2].
Vim-fork focused on extensibility and usability
References:
[1]: https://github.com/neovim/neovim
[2]: https://github.com/neovim
lewis6991 [1] has done a fantastic job with gitsigns.nvim [2]. Highly recommend taking a look.
Git [3] integration for buffers
References:
[1]: https://github.com/lewis6991
[2]: https://github.com/lewis6991/gitsigns.nvim
[3]: /glossary/git/
Looking for inspiration? dotfiles [1] by thoughtbot [2].
A set of vim, zsh, git [3], and tmux configuration files.
References:
[1]: https://github.com/thoughtbot/dotfiles
[2]: https://github.com/thoughtbot
[3]: /glossary/git/
telescope-media-files.nvim [1] by nvim-telescope [2] is a game-changer in its space. Excited to see how it evolves.
Telescope extension to preview media files using Ueberzug.
References:
[1]: https://github.com/nvim-telescope/telescope-media-files.nvim
[2]: https://github.com/nvim-telescope
sqlfluff [1] by sqlfluff [2] is a game-changer in its space. Excited to see how it evolves.
A modular SQL linter and auto-formatter with support for multiple dialects and templated code.
References:
[1]: https://github.com/sqlfluff/sqlfluff
[2]: https://github.com/sqlfluff
cmp-copilot [1] by hrsh7th [2] is a game-changer in its space. Excited to see how it evolves.
copilot.vim source for nvim-cmp
References:
[1]: https://github.com/hrsh7th/cmp-copilot
[2]: https://github.com/hrsh7th