Wed 24. January 2024 | 2024-01-24
https://vim.rtorr.com/
Sun 21. January 2024 | 2024-01-21
If shift right mouse click in insert mode doesn't paste anything, try exiting and re-entering Neovim again
Sun 21. January 2024 | 2024-01-21
Setup
Install IdeaVim plugin
Setup ctrl Q for toggling Vim on/off

Settings
Turn Vim on
reserve certain shortcuts to IDE
like:
ctrl Q so we can toggle Vim efficiently
ctrl C to enable copying to OS registry
ctrl V to enable pasting from OS registry

Thu 18. January 2024 | 2024-01-18
How to paste using the yank register instead of delete register
"0p
Or skip delete register with black hole:
"_d
https://stackoverflow.com/questions/11993851/how-to-delete-not-cut-in-vim
Thu 18. January 2024 | 2024-01-18
https://useful-snippets.netlify.app/posts/vim/
Webstorm keyboard shortcuts
Sun 14. January 2024 | 2024-01-14
To search replace the following:
</b>:
to:
:</b>
You can use another separator.
Example using # instead of /:
:8,27s
Sat 13. January 2024 | 2024-01-13
GitHub
Docs
Prod
Sat 13. January 2024 | 2024-01-13
^
/ _ \
| : |
| 0. |
/] : [\
/_] _. [_\
| |
| |
|
|
Sat 13. January 2024 | 2024-01-13
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 [[ "$currentName" == */ ]]; then
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
Sat 13. January 2024 | 2024-01-13
hvor mye er deaktivert/ufordel i Webstorm/VSCode når du har på Vim plugin?
Webstorm IdeaVim
- IDE's multi-select with Ctrl D doesn't work with entering insert mode using eg. using
a
- but
c works
- Annoying to save file that is edited in commit changes window
- if in normal mode, pressing "Esc" will exit "commit changes"-window
- unlike when terminal is focused, you can't disable the "Esc-> focus normal file view"
paste from OS registry (copy paste from UI app into Webstorm in IdeaVim) Kan fikses ved å registrere ctrl C og ctrl V som IDE-shortcuts (se https://useful-snippets.netlify.app/posts/webstorm-ideavim-shortcut-settings/)
- vim search not as good as built-in search
- vim won't highlight/preview as you search/replace
- to activate built-in search you would have to give up
ctrl F and ctrl H to IDE
VSCode's Vim
- Fuzzy finder
- Search?
- Search in files?
Sat 06. January 2024 | 2024-01-06
If you mistakenly forget to unlink, you can manually clean up artifacts from yarn or npm.
For npm, the link command creates global packages which can be removed by executing:
sudo npm rm --global "mylib"
- https://github.com/jasonsturges/vite-typescript-npm-package
- Try
Maybe unlink package?
npm unlink @scope/package
clear / swap out cache on either project
npm install --cache /tmp/empty-cache
restart all servers
- try uninstalling globally and reinstalling dependency:
sudo npm rm --global @scope/library
npm rm --global @scope/library
npm ls --global @scope/library
npm uninstall @scope/library
npm i @scope/librayr@latest --save-exact
try deleting package.json
try restarting servers???
Sat 06. January 2024 | 2024-01-06
https://react.dev/reference/react/createContext
context.ts
import {createContext} from 'react';
export interface ContextProps {
darkTheme: boolean;
}
export const AppContext = createContext<ContextProps>({
darkTheme: true,
});
App
const Context2 = Context as React.Context<ContextProps>;
return (
<AppContext2.Provider value={{darkTheme: false}}>
{}