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
+27
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,33 @@ Or a merely indented comment:
86
86
87
87
And the cursor is placed anywhere before the `//`, it won't work as vim won't identify the current cursor position's syntax to be a comment. Pull Requests are welcome to improve this.
88
88
89
+
### Ignoring filetypes
90
+
91
+
If you want to explicitly declare a set of filetypes that cosco will ignore you can add one of the following lines to your `.vimrc`:
92
+
93
+
```vim
94
+
let g:cosco_filetype_whitelist = ['php', 'javascript']
95
+
let g:cosco_filetype_blacklist = ['vim', 'bash']
96
+
```
97
+
98
+
These variables must be declared as a list (array) of languages recognized by vim
99
+
100
+
**Whitelist**
101
+
The `g:cosco_filetype_whitelist` variable is used to declare a list of filetypes that cosco will work in. If this variable is declared, cosco will ignore any filetype that is not specified in the whitelist variable.
102
+
103
+
**Blacklist**
104
+
The `g:cosco_filetype_blacklist` variable is used to declare a list of filetypes that cosco will ignore. If this variable is declared, cosco will ignore any filetype that is specified in the blacklist variable.
105
+
106
+
If neither of these variables are declared in the `.vimrc` cosco will work in any filetype.
107
+
108
+
The `g:cosco_filetype_whitelist` variable will override and ignore the `g:cosco_filetype_blacklist` variable if both variables are declared in your `.vimrc`.
109
+
110
+
**Getting the current filetype**
111
+
You can easily get the current filetype by calling:
112
+
```vim
113
+
:set ft?
114
+
```
115
+
89
116
## Auto CommaOrSemicolon Insertion Mode (Experimental)
90
117
91
118
Auto insertion of a comma or a semicolon is also supported through the function:
0 commit comments