Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore-regex for folder and subfolders in Sublime Text SFTP plugin

I've been in some trouble getting the ignore_regex option working in the Sublime SFTP plugin for Sublime Text. I'm not that good with regex, though I guess this should be fairly easy

My folder structure is pretty simple:

main_folder  
│
├─── css  
│    │    some other files
│    │    in the \css folder,
│    │    etc..
│    │    
│    └─── sass  
│          │    some other files
│          │    in the \sass folder,
│          │    etc..
│          │    
│          └─── sass_subfolders 
│                   some other files 
│                   in \sass_subfolders,
│                   etc..  
├─── other_folders  
│
etc...

I'd like that everything in the \sass folder, and the folder itself, to be ignored by sftp for uploading/syncing.

I've tried also with the configuration suggested in this post on the sublime forum , specifing to exclude the .scss files, yet it keeps uploading/syncing upon save and so on..

like image 487
Gruber Avatar asked Jun 21 '12 13:06

Gruber


2 Answers

To have an entire directory ignored by sublime sftp add it to your ignore_regexes settings like so:

"/folder_name/"

I use it to ignore octopress which generates my blog but doesn't need to be on the remote server itself. I also ignore the directory on the server that holds the generated blog, but doesn't live on my local machine in the same place.

This and a few more tips are on the plugin's faq page.

like image 159
Dan Lucas Avatar answered Sep 29 '22 10:09

Dan Lucas


Applying the accepted answer, add the folder you want to ignore into the ignore_regexes array in sftp-config.json. But you also need to know the default settings of ignore_regexes first wbond ref. For example, if you want to add "/folder_name/" folder, the final array will look like: "ignore_regexes": ["\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json", "sftp-settings\\.json", "/venv/", "\\.svn", "\\.hg", "\\.git", "\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini", "/folder_name/"],

like image 27
Jinsong Li Avatar answered Sep 29 '22 09:09

Jinsong Li