11/18/2023 0 Comments Vim shortcuts to directoriesYou open Vim at your project's root, but navigate to another project in the file explorer.You open Vim with a nested file/folder within your project.Where it breaks downĪny of the following cases will prevent you from searching the entire file structure of your desired project. It determines where the searching begins (in combination with the path variable). If you use any sort of file search or fuzzy search, the working directory affects the outcome of the search. This not only includes built in file searching solutions like Vim's find or grep commands, but also search plugins like CtrlP, Command-T, and fzf. Why does it matter?īefore we jump into the cases where the default working directory breaks down, why do we even care what Vim uses as the current working directory? The working directory is used for any Vim action that needs to know about the current file structure such as searching and file/directory based commands. It makes a lot of sense if you open Vim and stay in that project directory for the entirety of your working session, but it begins to breakdown with fairly typical use cases. Honestly, I don't believe this is a bad default. You can check the current working directory by running the command, pwd (print working directory). Vim's Default Working Directoryīy default Vim uses the directory that you opened Vim in as the default working directory. For that reason, it took me a while to realize that I was continually fighting with Vim's default working directory. Despite the obvious visual settings, there are a number of Vim defaults that are not apparent when you first start learning Vim, or even after you have been using Vim for a while if you were fortunate enough not to run into an issue. Without syntax highlighting, line numbers, or a variety of other defaults found in most modern editors, the initial headache is always configuring these basic settings before starting with Vim.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |