diff options
| -rw-r--r-- | cheatsheets/nvim-tree.md | 56 | ||||
| -rw-r--r-- | linux/lvm.md | 82 |
2 files changed, 56 insertions, 82 deletions
diff --git a/cheatsheets/nvim-tree.md b/cheatsheets/nvim-tree.md new file mode 100644 index 0000000..2d156f9 --- /dev/null +++ b/cheatsheets/nvim-tree.md @@ -0,0 +1,56 @@ +#### DEFAULT MAPPINGS *nvim-tree-default-mappings* +Mapping | Command | Description +---|---|--- +`<CR>` | edit | open a file or folder; root will cd to the above directory +`o` +`<2-LeftMouse>` +`<C-e>` | edit_in_place | edit the file in place, effectively replacing the tree explorer +`O` | edit_no_picker | same as (edit) with no window picker +`<C-]>` | cd | cd in the directory under the cursor +`<2-RightMouse>` | +`<C-v>` | vsplit | open the file in a vertical split +`<C-x>` | split | open the file in a horizontal split +`<C-t>` | tabnew | open the file in a new tab +`<` | prev_sibling | navigate to the previous sibling of current file/directory +`>` | next_sibling | navigate to the next sibling of current file/directory +`P` | parent_node | move cursor to the parent directory +`<BS>` | close_node | close current opened directory or parent +`<Tab>` | preview | open the file as a preview (keeps the cursor in the tree) +`K` | first_sibling | navigate to the first sibling of current file/directory +`J` | last_sibling | navigate to the last sibling of current file/directory +`C` | toggle_git_clean | toggle visibility of git clean via |filters.git_clean| option +`I` | toggle_git_ignored | toggle visibility of files/folders hidden via |git.ignore| option +`H` | toggle_dotfiles | toggle visibility of dotfiles via |filters.dotfiles| option +`B` | toggle_no_buffer | toggle visibility of files/folders hidden via |filters.no_buffer| option +`U` | toggle_custom | toggle visibility of files/folders hidden via |filters.custom| option +`R` | refresh | refresh the tree +`a` | create | add a file; leaving a trailing `/` will add a directory +`d` | remove | delete a file (will prompt for confirmation) +`D` | trash | trash a file via |trash| option +`r` | rename | rename a file +`<C-r>` | full_rename | rename a file and omit the filename on input +`e` | rename_basename | rename a file with filename-modifiers ':t:r' without changing extension +`x` | cut | add/remove file/directory to cut clipboard +`c` | copy | add/remove file/directory to copy clipboard +`p` | paste | paste from clipboard; cut clipboard has precedence over copy; will prompt for confirmation +`y` | copy_name | copy name to system clipboard +`Y` | copy_path | copy relative path to system clipboard +`gy` | copy_absolute_path | copy absolute path to system clipboard +`[e` | prev_diag_item | go to next diagnostic item +`[c` | prev_git_item | go to next git item +`]e` | next_diag_item | go to prev diagnostic item +`]c` | next_git_item | go to prev git item +`-` | dir_up | navigate up to the parent directory of the current file/directory +`s` | system_open | open a file with default system application or a folder with default file manager, using |system_open| option +`f` | live_filter | live filter nodes dynamically based on regex matching. +`F` | clear_live_filter | clear live filter +`q` | close | close tree window +`W` | collapse_all | collapse the whole tree +`E` | expand_all | expand the whole tree, stopping after expanding |actions.expand_all.max_folder_discovery| folders; this might hang neovim for a while if running on a big folder +`S` | search_node | prompt the user to enter a path and then expands the tree to match the path +`.` | run_file_command | enter vim command mode with the file the cursor is on +`<C-k>` | toggle_file_info | toggle a popup with file infos about the file under the cursor +`g?` | toggle_help | toggle help +`m` | toggle_mark | Toggle node in bookmarks +`bmv` | bulk_move | Move all bookmarked nodes into specified location + diff --git a/linux/lvm.md b/linux/lvm.md deleted file mode 100644 index 7329eb5..0000000 --- a/linux/lvm.md +++ /dev/null @@ -1,82 +0,0 @@ -### Create/Resize partitions using LVM (Logical Volume Manager) - Useful if we want a flexible disk storage that we either need to create separate partitions on, be able to resize them on the fly or create snapshots. - NOTE: LVM is exclusive to linux, no offical support in most other OS's (Windows,FreeBSD..) and is redundent on filesystems like BTRFS since it has it's own Subvolume feature. -#### LVM Concepts: - LVM is a Linux's native paritition type, other partition types are PC (MBR or GPT) that are considered standard and don't have the cool features of LVM. - - Device Mapper or dev/mapper (not exclusive to LVM) is a framework for mapping physical block devices onto higher-level virtual block devices - - Physical Volumes occupy the "whole of" or a partition of the actual disks/drives that are phyically present. - - Volume Groups are the overall collection of one or more physical volumes that encompass/split logical volumes. - - Logical Volumes are the divided partitions of a volume group between potentially more than one disk/drive. - ```bash - ┌───────────────────────┐┌─────────────────────────────┐ - │ Physical Hard Drive ││ Physical Hard Drive │ - └───────────────────────┘└─────────────────────────────┘ - ┌───────────────────────┐ - │ Partition │ - └───────────────────────┘ - ┌───────────────────────┐┌───────────────────────┐ - │ Physical Volume ││ Physical Volume │ - └───────────────────────┘└───────────────────────┘ - ┌────────────────────────────────────────────────┐ - │ Volume Group │ - └────────────────────────────────────────────────┘ - ┌───────────────────┐ ┌──────────────────────────┐ - │ Logical Volume │ │ Logical Volume │ - └───────────────────┘ └──────────────────────────┘ - ┌───────────────────┐ ┌──────────────────────────┐ - │ Filesystem │ │ Filesystem │ - └───────────────────┘ └──────────────────────────┘ - ``` -#### Create/Extend/Reduce: - 1. First list/find out information about the partitions - `$ fdisk -l` # Needs root privileges, - `$ df -h` # Displays amount of disk space on filesystems, "-h" in human readable form - `$ lsblk` # List/find information about avaliable block devices/partitions - - Find info about VG(Volume Groups), PV(Physical Volumes) and LV(Logical Volumes): - - hello - `$ vgs` # Needs root privileges, - - hello - `$ lvs` - - Report information about Physical Volumes - `$ pvs` # Needs root privileges, - - 2. Unmount the partition/filesystem making sure we are not on it: - NOTE: It is best not to be on the filesystem currently being managed although it's possible on EXT3 and EXT4 but BTRFS and ZFS need the use of a program called grow (still safe to gather/list information on them though). - - Change to a different user and kill any processes of the target filesystem's user. - `$ su root` # If going to change (extend/reduce) a user's filesystem - `$ pkill <user>` # Make sure user's processes aren't running - or - `$ su <user>` # If going to change (extend/reduce) the root's filesystem - then - `umount /dev/path/<home_or_root>` - - 3. Create/resize partitions - - Create: - - Create the Logical Volume from existing free space within the Volume Group. The command below creates a LV with a size of 60GB from the VG called "vg1" and LV name is Stuff - NOTE: Always make meaningful volume and volume group names. - `$ lvcreate -L +60G --name Stuff vg1` - - Create a filesystem, creating the Logical Volume does not create the filesystem. The command below creates an EXT4 filesystem that fits the newly created Logical Volume. - `$ mkfs -t ext4 /dev/vg1/Stuff` -Add a filesystem label - -Adding a filesystem label makes it easy to identify the filesystem later in case of a crash or other disk related problems. - -e2label /dev/MyVG01/Stuff Stuff - - Resize: - - Reduce the Logical Volume: - - Extend the Logical Volume: - -Extend the Logical Volume (LV) from existing free space within the Volume Group. The command below expands the LV by 50GB. The Volume Group name is MyVG01 and the Logical Volume Name is Stuff. - -lvextend -L +50G /dev/MyVG01/Stuff - sudo lvextend -l 100%VG -r /dev/mapper/vg1-root - 4. Mount the partition - - - ``` - umount /dev/mapper/vg1-root - umount /dev/mapper/vg1-home - lvresize --resizefs -L -20G /dev/mapper/vg1-home - mount /dev/mapper/vg1-home - ``` - |