- neovim 0.9.0 or greater
- tmux (
brew install tmux
) - yabai (
brew install koekeishiya/formulae/yabai
) - skhd (
brew install koekeishiya/formulae/skhd
) - ripgrep / fzf (
brew install ripgrep fzf
) - lazygit (
brew install lazygit
)
This configuration uses plugins, for that reason we need to install them using the following command
<CTRL> A <SHIFT> I
Sessions can be attached to and detached from, this allows us to have multiple sessions running at the same time and switch between them. Each session can have multiple windows.
-
To create a session type
tmux
in the terminal. -
To disconnect from a session run
<CTRL> A D
-
To start a whole new session for another tmux session (maybe for another project) run
tmux
again -
To swtich quickly between sessions run
<CTRL> A E
to pick which session you want to switch to -
To rename a session to something useful instead of
1
or2
etc then run<CTRL> A $
and type the name you want to use -
Within each session we can create multiple windows, to create a new window run
<CTRL> A
and thenC
-
To rename a window run
<CTRL> A ,
and type the name you want to use -
To switch windows run
<CTRL> A
and thenN
orP
to move to the next or previous window or just type the number of the window you want to switch to
Inside neovim run :Lazy
I have configured a lot of keymaps to make life easier for ME, your milage may vary, feel free to edit keymaps.lua
to suit your needs. Also, if you press the leader key and nothing else, you will be presented with a cheatsheet after 1 second or so.
All the usual vim navigation commands work, however I have added some extra ones to make life easier
- type
s
followed by two letters you are looking for, you will then be taken to the first match. If there are any more then you will be able to use the key shown.
- Goto the file you want to test, for example
User.php
in the models directory - Type
,e
which will try and switch to the test for that class - If it can't find one, it will ask if you want to create a feature test or a unit test
- Once the blank file is open, type
ftest
orutest
to load a test class snippet
,1
to toggle the sidebar with the current file focused
]h and [h
to move up and down through hunks, you can also hit<leader>g
to bring up lazygit inside neovim
- Use
:LspInfo
to see what language servers are attached to the current buffer - use
:Mason
to install and update language servers - use
:PhpActorClassNew
to create a new class from a template
,cf
to toggle a terminal window that floats,cc
to toggle a terminal window at the bottom of the screen
,tt
when viewing a test runs the whole test suite,tn
when viewing a test runs the test nearest the cursor,tf
when viewing a test runs all the tests in the file
- Use
SHIFT-V
to get into visual block mode gc
to comment or uncomment
- To change double quotes to double, from "test" to 'test' place the cursor over the double quote and then type the command
cs"'
(change surround from " to ')
- Use
dax
to delete around the xml attribute (ie, class="foo") or - Use
dix
to delete inside the xml attribute (ie, class="foo")
<Ctrl>+P
to find files<leader> pv
to find files including vendor directories<leader> pg
to find files only in the git repository<leader> o
to find recently opened files<leader> bb
to find a file in an open buffer<leader> ff
to find a file containing some text (ripgrep)
When searching using ripgrep we can pass some extra arguments in the search like so :-
"foo" app
search for foo in the app directory"foo" -tphp
search for foo in php files only"foo" -tphp app
search for foo in php files only within the app folder
If you want to move between a few files in a project quickly without having to use telescope of neotree, then you can mark file locations and switch between them quikly using harpoon.
<leader> <space> <space>
to mark a file at the current location<leader> <space>
to switch between the marked files
You can ask an assistant to give you hints and tips on concepts that you might need help with using <leader>m
.
mkdir .virtualenvs
cd .virtualenvs
python -m venv debugpy
debugpy/bin/python -m pip install debugpy
TailwindCSS is installed in the LSP, however it won't work unless tailwind is actually installed into the project, when viewing a file with tailwind classes, the colours will be displayed in the editor visually.
- Open Several Desktops (~7) on Your Machine
- Go To Keyboard Settings > Shortcuts > Mission Control
- Expand Mission Control and Turn On Shortcuts for Switching Spaces 1-7 with "Ctrl + # Of Space"
- Go to System Settings > Accessibility > Display
- Turn On Reduce Motion
- Go To System Settings > Desktop & Dock > Mission Control
- Turn off "Automatically Rearrange Spaces Based On Most Recent Use"
I use this exact configuration https://www.josean.com/posts/yabai-setup (video format: https://www.youtube.com/watch?v=k94qImbFKWE) however a few notes about restarting these services using brew.
brew install koekeishiya/formulae/yabai
brew install koekeishiya/formulae/skhd
instead of
brew services start yabai
brew services restart yabai
use
yabai --start-service
yabai --restart-service
Same with SKHD.