Commit Graph

39 Commits

Author SHA1 Message Date
Phil Runninger
aa7e97b7ff
Change highlighting of bookmarks in the tree. (#1261)
* Change highlighting of bookmarks in the tree.

The bookmark names in the tree now have the same syntax highlighting as
the bookmark names in the list of bookmarks above the tree.

* Change version number in change log.
2021-09-11 11:31:39 -04:00
Yeri Pratama
4a32dd0be3
fix highlight for file node (#1157)
* fix #960 953 highlight for file node

* update changelog
2020-07-24 11:14:54 -04:00
Phil Runninger
e571d3e95b
Make sure symbolic links' flags are highlighted correctly. (#1156)
* Make sure symbolic links' flags are higlighted correctly.

* Update version number in change log.
2020-07-17 14:11:08 -04:00
Phil Runninger
635071dcc8 Closes #1136. Allow concealed characters to show another character.
conceallevel=3 always hides the character, but conceallevel=2 allows an
alternate character to be displayed instead.
2020-06-01 01:51:27 -04:00
Phil Runninger
e41dd019d9 Reorder syntax statements to fix highlighting. 2020-02-05 15:09:24 -05:00
Phil Runninger
2388af7754 WIP: A better regex for NERDTreeExecFile. Still not all right. 2020-02-04 02:08:08 -05:00
Phil Runninger
6d3743549c Fix vint errors: Use robust operators ==# and !=# 2020-02-03 02:28:53 -05:00
Phil Runninger
961c3571c4 WIP: Fix syntax highlighting when arrows are empty strings.
Also improved some highlighting to make use of g:NERDTreeNodeDelimiter,
which directly surrounds the filename. More of this to come as errors
are tracked down and fixed in this file.
2020-02-03 01:59:41 -05:00
Caleb Maclennan
45e33f2502
Fix lint warnings: prefer single quoted strings 2019-12-31 09:42:14 +03:00
Caleb Maclennan
d8d799a4d6
Fix VimL syntax error: escapes work differently outside quotes 2019-12-31 09:40:58 +03:00
Phil Runninger
ffa8be8aa7
Document NERDTreeNodeDelimiter #912 (#926)
* Change the default node delimiter to the BELL character, \x07.

* Syntax match by ASCII code, vs. string concatenation.

* Document the NERDTreeNodeDelimiter setting.

* Clean up the documentation markup.

* Remove apostrophes, since the NERDTree settings aren't vim options.
* Use backticks to hot-link the referenced vim options.
* Add a modeline.

* Update the title and the About section of the documentation.

* Fix typo, and clarify branches of code in Github.

* Fix wrapping to 78, and remove colorcolumn setting from modeline.

* Change the ASCI Art title, and give credit for it.

* Change the word option to setting, and redo the word wrapping.

I want to reserve the word 'option' to mean only Vim options that are
changed with the `:set` command. Since we need to use `:let` to
establish the values for the NERDTree variables, I choose to call them
settings instead.

* Realign hot-links with concealed markup tags taken into account.

* Text alignment, typo fixes, and wordsmithing the About section.
2018-12-06 01:08:16 -05:00
Phil Runninger (mac)
f406af39cf Merge branch 'master' of github.com:scrooloose/nerdtree 2018-11-12 11:18:07 -05:00
Phil Runninger (mac)
64c3a6aed3 Change the containedin to ALL to conceal delmiter after filename. 2018-11-12 11:17:20 -05:00
Kristijan Husak
6fe967b3b3 Allow highlighting more than one flag. (#908) 2018-11-05 10:12:07 -05:00
Phil Runninger (mac)
8d005db94f Use substitute() for backward compatibility. Change conceallevel to 3. 2018-10-31 08:45:43 -04:00
Phil Runninger
91e0f2253f
Support unusual characters in file and directory names (#868)
* Use a delimiter in node to separate file/dir name from the rest.

* Switch warning message to use nerdtree#deprecated function.

* Compress the space between the tree symbols and the node.

* Include the delimiter when calculating indent or getting filename.

* Don't need to strip leading delimiter. It will already be gone.

* Simplify the way the delimiter is being used.

I don't know what I was thinking. The delimiter doesn't need to be used
to separate every indicator on the node's text, ie.

Bad:    Tree|GenericFlags|Filename|ExecutableFlag|Link|ReadonlyFlag
Better: Tree GenericFlags|Filename|ExecutableFlag Link ReadonlyFlag

This was unnecessary, given that we're only interested in the filename.
So, just one pair of delimiters is all we need. That greatly simplifies
the _stripMarkup function, and restores a bunch of other statements to
what they already are in the master branch.

* Add syntax highlighting to conceal the delimiter

* Put a if has("conceal") check around the syntax statement using it.

* Make concealment work correctly for LinkFile and readonly files.

* Use highlight Ignore if conceal isn't available.

This is probably the best we can do, especially if some other character
must be used in place of nbsp.

* Make the regex better match the original, but more compact.

It was allowing 2+ spaces, instead of only 1+.

* Fix the syntax highlighing of delimiters around NERDTreeExecFile.

* Bug fix: Parse . and .. from path string with trailing slash.

* Fix unresponsive cascaded directories.

Using ':' as a more visible delimiter, when directories are cascaded,
the line appears in NERDTree like so:

▾ :lib/::nerdtree/:

Before this commit, the s:UI._stripMarkup function was leaving the
internal delimiters in place (lib/::nerdtree/). Now they are removed,
resulting in a valid path (lib/nerdtree/).

* Use .= to shorten statement. Use clearer substitutes to get node name.

* Remove node delimiters that terminate the line.

* If flags are needed after the node name, then put another delimiter
before them.
* When joining directory nodes for cascaded display, strip off the
delimiter from the child node(s).
* Remove the unnecessary substitution of doubled intermediate
delimiters, since they're not in there anymore.

* DRY up the addition of the 2nd delimiter, and use only 1 for all tags.
2018-10-24 22:41:13 -04:00
Jason Franklin
d68c9abca8 Improve three highlighting rules
The highlighting rules "NERDTreeClosable" and "NERDTreeOpenable" did
not recognize files beginning with a "~" character. This caused bad
highlighting on systems that use "~" and "+" for the dir arrow
symbols by default. Making these rules more specific solves this
problem.

The "~" characters in quickhelp section titles also would get
confused with a custom mapping for "~". Adjusting the
"NERDTreeHelpTitle" solved this problem.

I also changed the quickhelp title in a minor way to reflect the
proper spelling of "NERDTree".
2017-07-29 09:40:11 -04:00
瓜牛
32186f1660 Update NERDTreeOpenable and NERDTreeClosable color
It is more comfortable
2016-10-13 13:38:36 +08:00
Phil Runninger
9ff2096b04 Merge pull request #548 from adityanatraj/master
Issue #537: Fix dir arrows not functioning properly
2016-09-21 22:32:13 -04:00
Alex Carlson
dfb9111786 Allow user-defined RO indicator.
(inspired by overwriting g:NERDTreeDirArrowCollapsible/Expandable)

Replace instances of the RO string with a variable that the user can
override. Useful for custom unicode glyphs, i.e. Font Awesome.

* Initialize variable g:NERDTreeGlyphReadOnly = "RO".
   -> plugin/NERD_tree.vim
* Replace instances of 'RO' with g:NERDTreeGlyphReadOnly
2016-02-26 17:57:40 -08:00
Aditya Natraj
68dce4f994 Issue #537: Fix dir arrows not functioning properly
added characters that are special when within character
classes in a regular expression to the `escape(...)` call
when building `s:dirArrows`.

this does not fix when `' '` or `''` are your `dirArrows` and you
can't open up subdirs. i think that's an issue with how nerdtree
distinguishes things to traverse in the filetree.
2016-02-06 18:11:52 -05:00
Martin Grenfell
a2b06bbac3 remove references to NERDTreeDirArrows
Closes #515
2015-11-26 00:25:06 +00:00
Martin Grenfell
0b44415a33 Merge pull request #486 from Xuyuanp/syntax
Made NERDTreeFlags contained in NERDTreeExecFile
2015-09-18 09:42:32 +01:00
Xuyuan Pang
d66370a8e5 Made NERDTreeFlags contained in NERDTreeExecFile 2015-09-17 11:30:14 +08:00
Igor Tatarintsev
8c8c794104 Added character escaping to syn match regexes 2015-09-15 23:22:14 +06:00
Igor Tatarintsev
dc29ec2db3 Added global variables for changing default arrows
g:NERDTreeDirArrowExpandable
g:NERDTreeDirArrowCollapsable
2015-09-11 23:52:37 +06:00
Igor Tatarintsev
188bd92658 Added global variables for changing default arrows 2015-09-11 23:44:06 +06:00
Martin Grenfell
f8499462c5 Revert "Use different arrow characters for compatibility."
This reverts commit f6cad7e957.
2015-05-02 11:29:43 +01:00
Curtiss Howard
f6cad7e957 Use different arrow characters for compatibility. 2015-04-17 17:36:23 -04:00
Martin Grenfell
2f552e116d add highlighting for flags
Rename the old NERDTreeFlag syntax item to NERDTreeIgnore.
2014-07-10 23:35:42 +01:00
Martin Grenfell
b64942a500 uncomment out some needed syntax matching code... fail 2014-06-30 09:40:51 +01:00
Martin Grenfell
e954b2e6f8 trivial highlighting update for consistency 2014-06-29 21:44:40 +01:00
Martin Grenfell
e68e12a33b fix highlighting for readonly files 2014-06-29 21:44:19 +01:00
Martin Grenfell
b33d6daf0b remove the NERDChristmasTree option
If users want to customise the tree colours, this can be done trivially
in their vimrc. e.g.

    hi link NERDTreeFile error
2014-06-29 19:53:57 +01:00
Martin Grenfell
abb93879bb simplify the syntax matching code slightly 2014-06-29 19:53:30 +01:00
Martin Grenfell
634c23eadb Merge branch 'better_symlink_highlighting' into update_highlighting
Conflicts:
	syntax/nerdtree.vim
2014-06-29 18:28:28 +01:00
Martin Grenfell
9d9edd03d4 separate out syntax matching for Dir Arrows vs old style 2014-06-29 18:17:19 +01:00
Martin Grenfell
9704a38a14 update symlink highlighting
Previously we highlighted symlinks as one item (NERDTreeLink):

    symlinked_file -> /path/to/target

Split this out into 3 highlight groups:
    * NERDTreeLinkFile
    * NERDTreeLinkDir
    * NERDTreeLinkTarget

So we have:

    symlinked_dir/ -> /foo/bar
    -------------- ***********
         ^               ^
         |               |
    NERDTreeLinkDir   NERDTreeLinkTarget

Similarly for file links - with NERDTreeLinkFile instead of
NERDTreeLinkDir.

This allows users to modify how symlinks are highlighted. E.g. to make
them appear as normal files/dirs they could add this to their vimrc:

    hi link NERDTreeLinkFile NERDTreeFile
    hi link NERDTreeLinkDir NERDTreeDir
    hi link NERDTreeLinkTarget ignore
2014-06-29 16:23:58 +01:00
George Ang
70ba0d60ec separate syntax file for better combacibility with plugins that reloads
vimrc files(such as perdirvimrc) after BufRead.
2011-06-18 23:56:31 +08:00