Skip to content

Commit

Permalink
basics: creating a directory with telescope or commands
Browse files Browse the repository at this point in the history
Resolve #11
  • Loading branch information
practicalli-johnny committed Jan 22, 2024
1 parent e6978b7 commit 765ac69
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- source-control: add nvimdiff configuration and use for Git diff views
- install: neovim GitHub release install on MacOSX
- basics: neovim registers guide
- basics: creating a directory with telescope or commands

### Changed
- ci: spell lychee & repository trufflehog linters warn only (false positives)
Expand Down
26 changes: 24 additions & 2 deletions docs/neovim-basics/file-buffer-window-tab.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Use [Telescope](#telescope) to select files, typing a name narrows the file list

++spc++ ++"o"++ toggles between buffer and neo-tree

!!! EXAMPLE "Configure hidden files"
??? EXAMPLE "Configure hidden files"
Configure Neotree to display hidden files and directories by default. They are shown with a different visual style (subtle color) compared to the other files and directories.

`H` with the cursor in neotree window will still toggle the display of hidden files and directories.
Expand Down Expand Up @@ -110,7 +110,7 @@ A file must exist for Neovim to write to it. Neo-tree and Telescope can be used

++spc++ ++"n"++ creates a new buffer that can be written to a given file using `:write path/to/filename`

`:write path/to/filename` will write the current buffer to a new file.
++spc++ ++"W"++ was added to Practicalli Astro Config as a key binding for `:write path/to/filename` which writes the current buffer to a new file, prompting for the file name.


=== "Practicalli Neovim Config Redux"
Expand Down Expand Up @@ -143,6 +143,28 @@ A file must exist for Neovim to write to it. Neo-tree and Telescope can be used
`!` is the NeoVim terminal shell command, e.g. `:!mkdir -p path/to/new/directory` creates a new directory and any intermediate path


### Directories

++"a"++ in Neotree to create a file or by adding a ++forward-slash++ at the end of the name a directory is created.

Use the `mkdir` shell command to create a new directory, which is created relative to the current path, which can be checked with `:lcd`

`:!mkdir full/path/to/new/directory`

If a file is already opened, i.e. with `:edit`, there is some short-hand syntax to simplify the typing

```shell
:!mkdir -p %:h
```

`mkdir -p` - the UNIX command to create a folder, the `-p` option creating any parts of the path required to make the full path

`%` - name of the current file

`:h` - for the current directory (the “head” of the path).

`!` - the NeoVim terminal shell command


### Swap file

Expand Down

0 comments on commit 765ac69

Please sign in to comment.