merge new posts from main into nvim-redesign
BIN
public/cmp-doc-screenshot.png
Normal file
After Width: | Height: | Size: 239 KiB |
BIN
public/cmp-screenshot.png
Normal file
After Width: | Height: | Size: 192 KiB |
BIN
public/default-ui-select-screenshot.png
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
public/gitsigns-hunk-change-popup-screenshot.png
Normal file
After Width: | Height: | Size: 100 KiB |
BIN
public/gitsigns-readme-screenshot.png
Normal file
After Width: | Height: | Size: 626 KiB |
BIN
public/lualine-readme.png
Normal file
After Width: | Height: | Size: 326 KiB |
BIN
public/mason-screenshot-zoomed.png
Normal file
After Width: | Height: | Size: 694 KiB |
BIN
public/no-neck-pain-readme.png
Normal file
After Width: | Height: | Size: 851 KiB |
BIN
public/nvim-cxx-screenshot-zoomed.png
Normal file
After Width: | Height: | Size: 826 KiB |
BIN
public/nvim-cxx-screenshot.png
Normal file
After Width: | Height: | Size: 789 KiB |
BIN
public/nvim-filetree-screenshot-zoomed.png
Normal file
After Width: | Height: | Size: 799 KiB |
BIN
public/nvim-filetree-screenshot.png
Normal file
After Width: | Height: | Size: 707 KiB |
BIN
public/nvim-go-screenshot-zoomed.png
Normal file
After Width: | Height: | Size: 538 KiB |
BIN
public/nvim-go-screenshot.png
Normal file
After Width: | Height: | Size: 619 KiB |
BIN
public/nvim-lazy-screenshot-zoomed.png
Normal file
After Width: | Height: | Size: 827 KiB |
BIN
public/nvim-lazy-screenshot.png
Normal file
After Width: | Height: | Size: 636 KiB |
BIN
public/nvim-tree-readme.png
Normal file
After Width: | Height: | Size: 424 KiB |
BIN
public/telescope-ui-select-screenshot.png
Normal file
After Width: | Height: | Size: 532 KiB |
11
src/content/blog/embracing-impostor-syndrome.md
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: embracing impostor syndrome
|
||||
description: how i (and you) should deal with impostor syndrome
|
||||
pubDate: Jul 10 2024
|
||||
---
|
||||
|
||||
a common advice of dealing with impostor syndrome is to brush it off, telling yourself that you are not an impostor and that you are better than you think. while i am not denying that it is a good measure, i would argue that a better way to cope with it is to embrace it - you may not be as bad as you think, but you are also not as good as you can be, and you should strive to fill the gap, whether in knowledge, in abilities, or in experience. having impostor syndrome means that you are surrounding yourself with ppl that are equally knowledgable if not more, and that's a good thing. as the saying goes, if you are the smartest person in the room, find another room.
|
||||
|
||||
using twt has probably triggered the most severe impostor syndrome i have ever experienced. constantly seeing what other ppl are building have made me realized just how much there is still for me to learn and to experience. i would like to think i am a competent software engineer, but compared to what others are doing, my work is trivial in comparison. that gap in skills and in knowledge is what keeps pushing me to learn, to build, to be better at my craft, and to ultimately leave my comfort zone to pursue a different field of study. you may disagree with my impostor syndrome, but to a degree, i am, and there is no denying of it.
|
||||
|
||||
who needs self-discipline when smart people are disciplining myself all the time? will my impostor syndrome ever stop? only when i have learned all there is to learn.
|
186
src/content/blog/my-neovim-setup.md
Normal file
@@ -0,0 +1,186 @@
|
||||
---
|
||||
title: 'my neovim setup'
|
||||
description: 'keybinds and plugins i use with my neovim.'
|
||||
pubDate: 'Jun 18 2024'
|
||||
---
|
||||
|
||||
i used to be an avid intellij user, until [@juweeism](https://x.com/juweeism) came in with this tweet:
|
||||
|
||||
<blockquote class="twitter-tweet" data-theme="dark"><p lang="en" dir="ltr">pivot to vim tonite king?</p>— juwee (@juweeism) <a href="https://twitter.com/juweeism/status/1768997650219888849?ref_src=twsrc%5Etfw">March 16, 2024</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
||||
|
||||
as an easily manipulated inidividual, this was enough to convince me to end my 7-year relationship with intellij ides and begin a brand new chaper in a brand new coding environment. little did i know this switch would be a permanent one.
|
||||
|
||||
this poast documents all the plugins and keybinds that i have installed and actively use.
|
||||
|
||||
## screenshots
|
||||
|
||||
the preview shows a zoomed-in ui for legibility. click on an image to see the ui in its original scale!
|
||||
|
||||
<figure>
|
||||
|
||||
[](/nvim-go-screenshot.png)
|
||||
|
||||
<figcaption>my neovim with go code opened</figcaption>
|
||||
|
||||
</figure>
|
||||
|
||||
<figure>
|
||||
|
||||
[](/nvim-cxx-screenshot.png)
|
||||
|
||||
<figcaption>my neovim with c++ code opened</figcaption>
|
||||
|
||||
</figure>
|
||||
|
||||
<figure>
|
||||
|
||||
[](/nvim-filetree-screenshot.png)
|
||||
|
||||
<figcaption>my neovim with the file tree opened</figcaption>
|
||||
|
||||
</figure>
|
||||
|
||||
## color theme
|
||||
|
||||
i use [catppuccin](https://github.com/catppuccin/catppuccin) for everything, including my neovim, my terminal, and even this website!
|
||||
|
||||
## package manager
|
||||
|
||||
i use [lazy.nvim](https://github.com/folke/lazy.nvim) as my package manager of choice. one thing i like about lazy is that it comes with a ui for managing and updating plugins:
|
||||
|
||||
|
||||
<figure>
|
||||
|
||||
[](/nvim-lazy-screenshot.png)
|
||||
|
||||
<figcaption>my neovim with lazy opened</figcaption>
|
||||
|
||||
</figure>
|
||||
|
||||
to update plugins, i simply press `shift+u`, and lazy will automatically update plugins and list all breaking changes after the update is complete. very handy!
|
||||
|
||||
## centered buffer
|
||||
|
||||
in (neo)vim, buffers are left aligned. when there is only one buffer opened, text starts from the very left edge of the window. if the window is maximized, the text will begin from the very left edge of my monitor, which makes it hard to read! thankfully, [no-neck-pain](https://github.com/shortcuts/no-neck-pain.nvim) is a plugin that centers the active buffer by placing two equally-sized buffers on both sides of the active buffer.
|
||||
|
||||

|
||||
|
||||
now, not only is the buffer directly in my line of sight, i now also get two empty buffers that i can use as scratch pads.
|
||||
|
||||
no-neck-pain is also smart enough to detect splits, which means splits will work as normal. when i trigger a vertical split by pressing `<C-w><C-v>` for example, the two empty buffers go away, and i will be presented with two equally split buffers. once i close either buffer, the remaining buffer will be centered again.
|
||||
|
||||
## file tree
|
||||
|
||||
most editors and neovim setups out there have a file tree that is always visible to the left of the current buffer. however, in my experience, i rarely need to look at the file tree, so having it constantly visible becomes a distraction. [nvim-tree](https://github.com/nvim-tree/nvim-tree.lua) is a file tree written in lua that supports floating mode.
|
||||
|
||||

|
||||
|
||||
in floating mode, the file tree is presented in a floating window instead of inside an always visible buffer. by default, it appears at the top left hand corner of the window, which is not very readable, so i found a piece of code online that centers the window. unfortunately, i was not able to trace back the source of the code.
|
||||
|
||||
nvim-tree also supports file manipulation, such as creating files or directories. it allows me to create files by typing in the full path of where it should be, and it will creating all the necessary directories for me. very handy!
|
||||
|
||||
with this setup, all that is visible at all time is the currently active buffer(s) and statuslines, and nothing else.
|
||||
|
||||
## status line
|
||||
|
||||
this brings us to statusline. i use [LuaLine](https://github.com/nvim-lualine/lualine.nvim) as my statusline plugin of choice.
|
||||
|
||||

|
||||
|
||||
by default, the statusline displays the current mode, the active branch, as well as the name of the file opened in the current buffer and its type. i find that having the global statusline display "local" information about a buffer unintuitive, and i'd much rather have a separate line that is attached to the active buffer. LuaLine enables this via the `winbar` config, which is a statusline bar at the top of the buffer. i configured it so that only the winbar of the active buffer is visible. this lets me know which buffer i am editing, as well as reduce visual clutter.
|
||||
|
||||
now, the global statusline, which always sits at the bottom no matter which buffer i am editing, displays the following:
|
||||
|
||||
- the current vim mode;
|
||||
- the active git branch; and
|
||||
- the current date and time, which is particularly useful because i use my neovim in fullscreen which hides the system clock.
|
||||
|
||||
the winbar, attached to a buffer at the top, displays:
|
||||
|
||||
- the relative path of the opened file;
|
||||
- the encoding of the file;
|
||||
- the search count if a search is active;
|
||||
- any lsp diagnostics; and
|
||||
- the file type.
|
||||
|
||||
## lsp
|
||||
|
||||
although neovim has an lsp client built-in, i use [mason](https://github.com/williamboman/mason.nvim) to manage all my lsps, formatters and linters. it also manages daps (debugger adapter protocol) as well, but in the rare cases that i need a debugger, i still rely on intellij ides, which is why i haven't set up debugging in neovim.
|
||||
|
||||
the best thing about mason is that, like lazy, it comes with a ui for managing your lsps and others:
|
||||
|
||||

|
||||
|
||||
to install a component, all i have to do is press `/` to search for it, and then type:
|
||||
|
||||
```
|
||||
:MasonInstall <component-name>
|
||||
```
|
||||
|
||||
to install the component. for example, if i want to install gopls, go's lsp, i can type:
|
||||
|
||||
```
|
||||
:MasonInstall gopls
|
||||
```
|
||||
|
||||
and it will be installed for you. one crucial plugin that acts as a glue between mason and neovim's built-in lsp client is [mason-lspconfig](https://github.com/williamboman/mason-lspconfig.nvim), which makes mason-managed components work with neovim.
|
||||
|
||||
## autocomplete
|
||||
|
||||
for me, an editor needs to have autocompletion feature, as i am lazy and can't type very fast (i.e. skill issue.) for this, i use [nvim-cmp](https://github.com/hrsh7th/nvim-cmp). it is heavily customizable, which allowed me to make it look really nice:
|
||||
|
||||

|
||||
|
||||
nvim-cmp also displays type info and docstring of the selected entry next to the popup:
|
||||
|
||||

|
||||
|
||||
## telescope
|
||||
|
||||
[telescope](https://github.com/nvim-telescope/telescope.nvim) is a generic fuzzy finder that is highly extensible. it has a [comprehensive list](https://github.com/nvim-telescope/telescope.nvim/wiki/Showcase) of built-in, ready-to-use pickers that you can use without any additional configuration. here are all the pickers that i have configured:
|
||||
|
||||
- [find files](https://github.com/nvim-telescope/telescope.nvim/wiki/Showcase#find-files);
|
||||
- [live grep](https://github.com/nvim-telescope/telescope.nvim/wiki/Showcase#live-grep), which searches through the content of all files in a directory;
|
||||
- [buffers](https://github.com/nvim-telescope/telescope.nvim/wiki/Showcase#buffers), which searches through the list of opened buffers; and
|
||||
- [lsp references](https://github.com/nvim-telescope/telescope.nvim/wiki/Showcase#lsp-references), which searches through all references to the symbol under the cursor in the project.
|
||||
|
||||
### overriding default selection ui with telescope
|
||||
|
||||
by default, when making selections in neovim (e.g. selecting an lsp code action), the list of actions appear at the bottom left of the screen:
|
||||
|
||||

|
||||
|
||||
using [telescope-ui-select](https://github.com/nvim-telescope/telescope-ui-select.nvim), i can override the default selection ui to use telescope instead. now, not only is this list centered, i can also search through the list of actions:
|
||||
|
||||

|
||||
|
||||
## git signs
|
||||
|
||||
[gitsigns](https://github.com/lewis6991/gitsigns.nvim) is a plugin that shows an indicator that indicates whether a line is inserted, changed, or deleted in git, next to the line numbers:
|
||||
|
||||

|
||||
|
||||
on top of that, it provides commands that let you preview the changes in a popup, like so:
|
||||
|
||||

|
||||
|
||||
it even lets you revert hunk changes!
|
||||
|
||||
## keybinds
|
||||
|
||||
most of my neovim keybinds start with `<space>`. this is because the space bar is always under my two thumbs, making it easily accessible. also, it is just plain satisfying to begin any action with a space bar! following the space bar, i usually follow mnemonics of the action i want to trigger. here are some keybinds i use frequently:
|
||||
|
||||
- `<space>f`: opens the **f**ile tree in a dialog
|
||||
- `<space>F`: opens the **s**earch **f**iles telescope dialog
|
||||
- `<space>b`: opens the **b**uffer telescope dialog
|
||||
- `<space>g`: opens live **g**rep
|
||||
- `<space>lg`: opens [**l**azy-**g**it.nvim](https://github.com/kdheepak/lazygit.nvim)
|
||||
- `<space>a`: opens lsp live **a**ction dialog
|
||||
- `<space>u`: finds all **u**sages of the symbol under the cursor
|
||||
- `<space>hp`: opens gitsigns' **h**unk **p**review pop up
|
||||
- `<space>hr`: performs a **h**unk **r**evert
|
||||
|
||||
## dotfiles
|
||||
|
||||
all my dotfiles, including my neovim config, [lives here](https://github.com/kennethnym/dotfiles) in a GitHub repo. the best way to install the dotfiles is to symlink the files to the appropriate path. for example, to use my neovim config on macOS, symlink the `nvim` directory to `~/.config/nvim`.
|
||||
|
33
src/content/blog/three-types-of-figures-in-your-life.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: 'three types of figures you need in your life'
|
||||
description: 'there are three types of figures you want in your life to help u succeed.'
|
||||
pubDate: 'Jun 26 2024'
|
||||
---
|
||||
|
||||
there are three types of figures that you want in your life to help you achieve your goals: role models, peers, and supportive figures. as you steer the ship through the vast, unchartered ocean of your future, they will be your loyal crewmates that stand by your side on your enduring adventure of life, braving through the tempests and celebrating the calm waters.
|
||||
|
||||
## role models
|
||||
|
||||
role models are people who possess traits that you admire and that align with your goals. you wish to learn from them and inherit their good traits so that you can better yourself, and ultimately be one of the reasons why you have reached important milestones in your life. a role model should be a motivator in your life that keeps you going. a role model may be a person you are close with, but they do not have to be.
|
||||
|
||||
no one is perfect; you do not have to agree with everything that your role model says or does. you can choose to have multiple (but not too many) role models, each possessing different characters that you want to learn from.
|
||||
|
||||
as an example, elon musk is one of my role models. i admire his persistence on his work, especially spacex. had he let doubters (proclaimed experts) of his work stop him from continuing, tesla would not have become what it is today - a major american automaker, and spacex would have likely been an insignificant chapter in history. however, i regularly disagree with his politics, and i especially do not appreciate the way he is carrying himself.
|
||||
|
||||
## peers
|
||||
|
||||
peers are people with with you actively work, whether they be co-workers, schoolmates, even co-founders. your peers and you form a rapid feedback loop that constantly guides you. since you work closely together, you learn from them as much as they do from you. they should one of the primary sources that help perfect your craft. hence, they should be people that are more knowledgable and more experienced. to quote an old chinese saying:
|
||||
|
||||
> a friend that is honorable, honest, and knowledgable is a good one.
|
||||
|
||||
it is crucial that you surround yourself with good peers. for me, choosing to be active on twitter allows me to surround myself with people that are "good friends" - honorable, honest, and way more knowledgable that i am.
|
||||
|
||||
while comparison should not be a thief of your joy, a healthy dose of comparison will be a powerful motivator for you to keep learning and be more skillful. compare yourself to your peers: what are something that they are knowledgable in but that i am not? what are they doing to help them achieve what they want, and will it be helpful to myself? make a note of your answers to those questions, and act accordingly. do not be let down by the fact that you are not as good as them. instead, make action plans to fill your knowledge gap. incorporate their habits into your life. do not be afraid to ask questions. **you are in control**.
|
||||
|
||||
## supportive figures
|
||||
|
||||
finally, supportive figures are people that may not be directly involved with your field of work, but that provide mental support and companionship. they are the people that you trust enough to vent to, to ask for life advice, and to cheer you up when you are feeling low. do not underestimate the power that they provide - i have learned, the hard way, that having someone you feel comfortable with having deep conversations, are crucial to not only let your inner problems out but also your personal development as well.
|
||||
|
||||
think of the part of your mind that stores your negative emotions and experiences as a pressure pot. not having a supportive figure is akin to having the valve of the pot sealed. as the content inside the pot inevitably grows, there comes a point where the pot cannot cope with the immense pressure built up over time and explodes - a *mental explosion*. some may resort to substances, but abusing substance is like removing the pressure meter from the pot. the pressure is still there, but you just cannot see it.
|
||||
|
||||
i understand it may not easy to find a person that you trust. unfortunately, i am not in a position to provide any advice in this regard, as much as i would like to, because this is a personal matter that only you can decide for yourself.
|