Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Is there any plugin that I can use to auto indent html in "smarty" template.
the way i do this in vim is like:
while editing a smarty template:
:set filetype=html
press "=G" after moving cursor to the head of file
Is there a plugin for vim that can do this for me?
For anyone who's still looking for an answer to this, simply add the following line to your vimrc:
au BufRead,BufNewFile *.tpl set filetype=html
The above will treat .tpl files as HTML. You can swap the values (tpl/html) for whatever other combination as well.
Once your file is open, just use this keystroke to indent:
gg=G
This plugin handles indenting of HTML and PHP in Smarty templates: https://github.com/blueyed/smarty.vim
You weren't clear on what editor you were looking for a plugin for (vim?).
There are a number of IDE's that support Smarty formatting. I personally use Netbeans (see Smarty plugin for NetBeans), but there are also PHP Storm, CodeLobster, and Aptana to name a few more.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 months ago.
Improve this question
In VIM text editor, everytime whenever I type ''typedef '', it gets highlighted automatically. How to fix this?
I want to turn off word highlighting property in vim.
Looks like you have the "highlight search" flag on and the last search was for typedef. You can turn the flag off with :set nohls.
You can inspect all settings with :set all.
You can read the help for highlight search with :help hls.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have tried fixing vim to my likings but I alawys encountered a lot of problems due to my lack of knowldege.The most commons ones are:
Powerline font not rendering properly example here
Syntax Highlighting not giving the expected color
Background color not being rendered properly
I am aiming for a result which would look pretty similiar to this when I currently have this.
If the information given is not enough I will give you additional information in the comments. Any help would be greatly appreciated!
You seem to be asking 2 questions:
How do you get fancy font characters for *line plugins?
Where are my syntax highlighting colors?
Fancy font patching
You will need to refer to your status line plugin for how it wants you to patch a font and setup your terminal. vim-powerline for example has instructions on how to do this.
Syntax highlighting colors
You need to make sure you have the following lines in your vimrc file:
filetype plugin indent on
syntax on
This will turn on syntax highlighting and filetype specific plugins (aka ftplugins). As long as you have a color terminal and $TERM is set correctly then the colors should show.
Make sure you also specify a colorscheme via :colorscheme in your vimrc file as well:
colorscheme nord
It should also be noted that nord colorscheme requires you to update your terminal's theme as well in order to work properly.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have already setup vim size to 4 in ~/.vimrc. It is working when I enter tab, but the original file display tab in size 8. How to make them all in size 4?
Thank you,
:verbose setlocal tabstop? softtabstop? expandtab? shiftwidth?
will show you the current indent settings (and where it got defined). Since these are buffer-local settings, it's not enough to set this once in your ~/.vimrc. Several filetype plugins change these indent settings. (Though typically not 'tabstop', but rather 'softtabstop'.
You could avoid that by turning off filetype plugins altogether (drop :filetype plugin on from your ~/.vimrc), but it's better to selectively override this in the after directory.
Put your :setlocal ... commands into ~/.vim/after/ftplugin/{filetype}.vim. (This requires that you have :filetype plugin on; use of the after directory allows you to override any default filetype settings done by $VIMRUNTIME/ftplugin/{filetype}.vim.) Alternatively, you could define an :autocmd FileType {filetype\} ... directly in your ~/.vimrc, but this tends to become unwieldy once you have many customizations.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
In vim, the latex-suite plugin is for tex filetype. I want to apply the convenience of vim latex-suite plugin for markdown filetype. How can I do it?
EDIT: I want to use markdown syntax to take notes. But It's not convenient for me to type formula in the markdown file. It will be very convenient If the latex-suite macros/shortcuts can be used in markdown file(with the markdown highlight syntax).
In vim I set this
:set ft=tex
:set syntax=markdown
and then I have all the latex-suite macros and shortcuts working, while the syntax highlighting is set to markdown.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a bunch of files in (project)/src and (project)/inc.
When I press <C-x><C-f> vim should give me suggestions about filenames from there but I couldn't find how to set the directories it searches in.
The documentation I read says only that <C-p> and <C-n> moves inside the list but nothing about calibrating the search path.
set autochdir
automatically sets the "current directory" to the one containing the current file. Put it in your vimrc, enjoy life.
Its the pwd or the path from where the vim was launched.Its not configurable.
Although a new feature called path-support will be available in vim soon:
http://vimdoc.sourceforge.net/htmldoc/options.html#%27path%27
That might help you configure more.
In the meantime try these vim plugins:
FuzzyFinder
http://www.vim.org/scripts/script.php?script%5Fid=1984
zvim
https://bitbucket.org/ZyX_I/zvim
t-command
http://www.vim.org/scripts/script.php?script_id=3025
Or you can write your own vim plugin.
Refer:
http://vim.wikia.com/wiki/Searching_for_files_in_a_directory_listing
And
http://vim.wikia.com/wiki/Source_vimrc_and_use_tags_in_a_parent_directory
This is what I've done to solve the problem, seems much more easier than #askmish solution.
Edit vimrc and add this mapping :
map <F4> :cd %:h<CR>
from now on, press F4 to switch to current directory.
Now when you press <C-X><C-F> you can see a list of all files in your current working directory.