You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# CWDPattern
1
+
# autocwd.vim
2
2
3
-
CWDPattern automatically changes the current working directory (CWD) of vim when you change the current buffer.
3
+
autocwd.vim automatically changes the current working directory (CWD) of vim when you change the current buffer.
4
4
You can define patterns that be may included in a name or file path of a buffer, and their working directories in your .vimrc.
5
5
The predefined working directories can be the directory of the current buffer's file, absolute paths of specific directories, and so on.
6
6
@@ -15,7 +15,7 @@ Screenshot:
15
15
You can define patterns and working directories in your .vimrc as follows:
16
16
17
17
```
18
-
let g:cwdpattern_patternwd_pairs = [
18
+
let g:autocwd_patternwd_pairs = [
19
19
\[pattern1, working_directory1],
20
20
\[pattern2, working_directory2],
21
21
...
@@ -33,15 +33,15 @@ For example, '~/test' changes the CWD to ~/test directory and '%:p:h' changes th
33
33
(Please refer http://vimdoc.sourceforge.net/htmldoc/cmdline.html#filename-modifiers for more information.)
34
34
35
35
- If the current buffer matches one of the defined patterns, the CWD will be changed to the corresponding working directory.
36
-
Otherwise, the default working directory that have been the CWD before applying `g:cwdpattern_patternwd_pairs` will be restored.
36
+
Otherwise, the default working directory that have been the CWD before applying `g:autocwd_patternwd_pairs` will be restored.
37
37
You can change the default working directory by `:cd` or other CWD-changing commands (e.g., 'cd' of the NERDTree) when the current buffer does not match any of predefined patterns.
38
38
39
-
- The order of patterns in `g:cwdpattern_patternwd_pairs` is meaningful.
39
+
- The order of patterns in `g:autocwd_patternwd_pairs` is meaningful.
40
40
If the current buffer matches both first and second patterns, the working directory corresponding to the first pattern will be the CWD.
41
41
42
42
An example pattern-wd pairs for the screenshot:
43
43
```
44
-
let g:cwdpattern_patternwd_pairs = [
44
+
let g:autocwd_patternwd_pairs = [
45
45
\['*.vim', '%:p:h'],
46
46
\['*.py', '%:p:h'],
47
47
\['*/vim74/*', '/home/testid/vim74'],
@@ -51,10 +51,10 @@ let g:cwdpattern_patternwd_pairs = [
51
51
52
52
## Commands
53
53
54
-
**:CWDPatternPrint**
54
+
**:AutoCWDPrint**
55
55
Print the buffer name or file path, matched pattern, and working directory of windows in the current tab.
56
56
57
-
There is no activation commands for CWDPattern.
57
+
There is no activation commands for autocwd.vim.
58
58
If you install this plugin, it will starts to manage the CWD.
59
59
60
60
## Motivation
@@ -63,5 +63,5 @@ It is quite useful to set the CWD for each opened file in vim.
63
63
Vim provides `:lcd` command for this purpose.
64
64
However, it cannot deal with opening other files in the same window because `:lcd` is applied to a specific window, not buffer.
65
65
66
-
CWDPattern is designed to solve this problem.
66
+
autocwd.vim is designed to solve this problem.
67
67
Moreover, it provides more convenient way to set CWDs with Unix shell-style patterns.
0 commit comments