Upgrade Ubuntu in terminal
Thu 25. January 2024 | 2024-01-25https://ubuntu.com/server/docs/upgrade-introduction
sudo apt update
sudo apt upgrade
https://ubuntu.com/server/docs/upgrade-introduction
sudo apt update
sudo apt upgrade
Ctrl [
eller begynn å scrolle
Ctrl c
eller q
https://stackoverflow.com/questions/67360866/tmux-exit-ctrl-b-and-stay-observing-the-session
https://askubuntu.com/questions/824496/how-do-i-access-tmux-session-after-i-leave-it
Ctrl b s
tmux ls
Med christoomey/vim-tmux-navigator
package og instrukser fra https://www.josean.com/posts/tmux-setup / https://www.youtube.com/watch?v=U-omALWIBos&t=584s
Ctrl b h
eller j
eller k
eller l
Ctrl h
eller j
eller k
eller l
Ctrl x
Ctrl o
Ctrl 6
Ctrl t
/ Ctrl d
<
/ >
.
to repeatCtrl t
Ctrl v
Ctrl x
Ctrl t
:tab h lualine
:cdo s/blaba/blaba/g
m[bokstav]
'[bokstav]
gd
ctrl o
wa
K
-> vim.lsp.buf.hover()
dt*
https://stackoverflow.com/questions/10658230/how-to-delete-until-end-of-delimiterda*
<li>foo</li>
-> citbar -> <li>bar</li>
If shift right mouse click
in insert mode doesn't paste anything, try exiting and re-entering Neovim again
Install IdeaVim plugin
Setup ctrl Q
for toggling Vim on/off
Turn Vim on
reserve certain shortcuts to IDE
like:
ctrl Q
so we can toggle Vim efficientlyctrl C
to enable copying to OS registryctrl V
to enable pasting from OS registryHow to paste using the yank register instead of delete register
"0p
https://stackoverflow.com/questions/11993851/how-to-delete-not-cut-in-vim
https://useful-snippets.netlify.app/posts/vim/
ctrl F1
To search replace the following:
</b>:
to:
:</b>
You can use another separator.
Example using # instead of /:
:8,27s#</b>:#:</b>
^
/ _ \
| : |
| 0. |
/] : [\
/_] _. [_\
| |
| |
|
|
# ask in what path the component resides in
# if no answer is provided, use default value
# -e flag is for giving `cd`-code completion while answering the question
defaultValue=src/components/
read -e -p "Where is component located? (default: $defaultValue): " location
location=${location:-$defaultValue}
cd $location
read -e -p "Enter component name you want to rename: " currentName
cd $currentName
# if component ends with a trailing slash
if [[ "$currentName" == */ ]]; then
# remove trailing slash
currentName=${currentName%/}
fi
indexFile=index.ts
componentFile=$currentName.tsx
storyFile=$currentName.stories.tsx
stylesheetFile=$currentName.module.css
stylesheetScssFile=$currentName.module.scss
if [[ $currentName != "" ]]; then
echo
echo "This will try and rename:"
echo "---- folder -----"
echo $currentName
echo
echo "---- files -----"
echo - $indexFile
echo - $componentFile
echo - $storyFile
echo - $stylesheetFile
echo - $stylesheetScssFile
echo
read -p "Enter new name: " newName
if [[ $newName != "" ]]; then
echo
echo "search replace in files"
echo
sed -i "s/$currentName/$newName/g" $indexFile
sed -i "s/$currentName/$newName/g" $componentFile
sed -i "s/$currentName/$newName/g" $storyFile
sed -i "s/$currentName/$newName/g" $stylesheetFile
sed -i "s/$currentName/$newName/g" $stylesheetScssFile
echo
echo "rename files and folders"
echo
mv $componentFile $newName.tsx
mv $storyFile $newName.stories.tsx
mv $stylesheetFile $newName.module.css
mv $stylesheetScssFile $newName.module.scss
cd ..
mv $currentName $newName/
fi
fi
hvor mye er deaktivert/ufordel i Webstorm/VSCode når du har på Vim plugin?
a
c
worksctrl C
og ctrl V
som IDE-shortcuts (se https://useful-snippets.netlify.app/posts/webstorm-ideavim-shortcut-settings/)ctrl F
and ctrl H
to IDE